Entity¶
-
class
OCP\AppFramework\Db\
Entity
¶ Source: lib/public/AppFramework/Db/Entity.php#36
Properties¶
-
public static property
OCP\AppFramework\Db\Entity::$
id
¶ Source: lib/public/AppFramework/Db/Entity.php#37
Methods¶
-
public static
OCP\AppFramework\Db\Entity::
fromParams
($params)¶ - Simple alternative constructor for building entities from a request
Source: Parameters: - $params (array) the array which was obtained via $this->params(‘key’)
in the controller
Returns: Since: 7.0.0
-
public static
OCP\AppFramework\Db\Entity::
fromRow
($row)¶ - Maps the keys of the row array to the attributes
Source: Parameters: - $row (array) the row to map onto the entity
Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
getFieldTypes
()¶ Source: lib/public/AppFramework/Db/Entity.php#86 Returns: array with attribute and type Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
resetUpdatedFields
()¶ - Marks the entity as clean needed for setting the id after the insertion
Source: lib/public/AppFramework/Db/Entity.php#95 Since: 7.0.0
-
protected
OCP\AppFramework\Db\Entity::
setter
($name, $args)¶ - Generic setter for properties
Source: lib/public/AppFramework/Db/Entity.php#103 Since: 7.0.0
-
protected
OCP\AppFramework\Db\Entity::
getter
($name)¶ - Generic getter for properties
Source: lib/public/AppFramework/Db/Entity.php#138 Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
__call
($methodName, $args)¶ - Each time a setter is called, push the part after setinto an array: for instance setId will save Id in theupdated fields array so it can be easily used to create thegetter method
Source: lib/public/AppFramework/Db/Entity.php#156 Since: 7.0.0
-
protected
OCP\AppFramework\Db\Entity::
isGetterForBoolProperty
($methodName)¶ Source: Parameters: - $methodName (string)
Returns: bool
Since: 18.0.0
-
protected
OCP\AppFramework\Db\Entity::
markFieldUpdated
($attribute)¶ - Mark am attribute as updated
Source: Parameters: - $attribute (string) the name of the attribute
Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
columnToProperty
($columnName)¶ - Transform a database columnname to a property
Source: Parameters: - $columnName (string) the name of the column
Returns: string the property name
Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
propertyToColumn
($property)¶ - Transform a property to a database column name
Source: Parameters: - $property (string) the name of the property
Returns: string the column name
Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
getUpdatedFields
()¶ Source: lib/public/AppFramework/Db/Entity.php#240 Returns: array array of updated fields for update query Since: 7.0.0
-
protected
OCP\AppFramework\Db\Entity::
addType
($fieldName, $type)¶ - Adds type information for a field so that its automatically casted tothat value once its being returned from the database
Source: Parameters: - $fieldName (string) the name of the attribute
- $type (string) the type which will be used to call settype()
Since: 7.0.0
-
public
OCP\AppFramework\Db\Entity::
slugify
($attributeName)¶ - Slugify the value of a given attributeWarning: This doesn’t result in a unique value
Source: Parameters: - $attributeName (string) the name of the attribute, which value should be slugified
Returns: string slugified value
Since: 7.0.0