Jet\DataModel_Definition_Property
The base abstract class that is common to define all property types. The classes representing each type inherit from this class.
Overview of methods
Method | Meaning of |
---|---|
public __construct( string $data_model_class_name, string $name, ?array $definition_data=null ) |
Parameters:
|
public setUp( array $definition_data ) : void |
Sets the definition using raw data retrieved from attributes. |
public setUpRelation( string $related_to_class_name, string $related_to_property_name ) : void |
Sets a relation - that is, sets that the given property is bound to another property ($related_to_property_name parameter) of another class ($related_to_class_name). |
public getDataModelClassName( ) : string |
Returns the name of the class to which the property belongs. |
public getType( ) : string |
Returns the identification of the property type. Thus, one of the constants DataModel::TYPE_* |
public getName( ) : string |
Returns the name of the property. |
public getDataModelDefinition( ) : DataModel_Definition_Model_Main| DataModel_Definition_Model_Related |
Returns the definition of the entity to which the property belongs. |
public getRelatedToClassName( ) : null|string |
Returns the name of the class to which the property is in relation. |
public getRelatedToPropertyName( ) : string|null |
Returns the name of the property of another class to which the property is in a relation. |
public getDatabaseColumnName( ) : string |
Returns the defined or generated column name of the database table. |
public getIsKey( ) : bool |
Indicates whether the property is marked as a (simple) key - index. |
public getIsUnique( ) : bool |
Indicates whether the property is marked as a (simple) unique key. |
public getIsId( ) : bool |
Indicates whether the property is marked as identifying. |
public doNotExport( ) : bool |
Indicates whether it is forbidden to export the property to JSON (or XML and any other export). |
public getMustBeSerializedBeforeStore( ) : bool |
Indicates whether the value of the property of the given type must be serialized before saving. |
public getCanBeTableField( ) : bool |
Indicates whether the property of the given type creates a database column at all. |
public getCanBeInSelectPartOfQuery( ) : bool |
Indicates whether the property of the given type can be used in the SELECT part of the query. |
public getCanBeInInsertRecord( ) : bool |
Indicates whether the value of the property of the given type can actually be stored in the database as a new record. |
public getCanBeInUpdateRecord( ) : bool |
Indicates whether the value of the property of the given type can actually be stored in the database as an update of an existing record. |
public getMaxLen( ) : int|null |
If the maximum length is relevant for the type, it returns it. |
public getDefaultValue( ) : mixed |
Returns the default value of the property. This is determined by the declaration of the property itself (i.e. the normal declaration of a class property - not defined within attributes) |
public checkValueType( mixed& $value ) : void |
Verifies and possibly maps the given value to the type (from the PHP point of view) relevant for the given type from the DataModel point of view. |
public loadPropertyValue( mixed& $property, array $data ) : void |
It takes a value from the raw data read from the database by the backend, overrides it and assigns properties to the entity instance. |
public getJsonSerializeValue( mixed& $property ) : mixed |
Returns the value of the property so that it is serializable to JSON format according to the specifics of the type. |
public getAllRelatedPropertyDefinitions( array& $related_definitions ) : void |
Internal method used to find all internal relations. |
public getBackendOptions( string $backend_type ) : array |
Returns the defined settings specific to the backend type. |