Model implements IErrorable
This class developed now only for models influencing with report visual constructor.
Table of Contents
Interfaces
- IErrorable
- Interface IErrorable
Constants
- ATTRIBUTE_SLICE_DELIMITER = '__'
Methods
- __call() : void
- Implement delete and add actions for nested relations.
- __construct() : mixed
- Model constructor.
- delete() : bool|null
- factoryWithHorizontalCells() : mixed
- getClassName() : string
- getCreatedAt() : DateTime
- getCurrentDbState() : array<string|int, mixed>
- getErrors() : array<string|int, mixed>
- Get Errors collections.
- getId() : mixed
- getMapAttributes() : array<string|int, mixed>
- Returns the list of pair for mapping data and object properties.
- getMapReferenceAttributes() : array<string|int, mixed>
- Returns map of lazy loaded attributes of current model.
- getTableClassName() : string|DataManager
- Gets the fully qualified name of table class which belongs to current model.
- getUpdatedAt() : DateTime
- load() : static
- loadAttribute() : void
- loadById() : static
- save() : Model
- setCreatedAt() : void
- setId() : void
- setUpdatedAt() : void
Constants
ATTRIBUTE_SLICE_DELIMITER
public
mixed
ATTRIBUTE_SLICE_DELIMITER
= '__'
Methods
__call()
Implement delete and add actions for nested relations.
public
__call(string $name, array<string|int, mixed> $arguments) : void
Parameters
- $name : string
-
Getter name.
- $arguments : array<string|int, mixed>
-
Arguments passed to getter.
__construct()
Model constructor.
public
__construct() : mixed
delete()
public
delete() : bool|null
Return values
bool|nullfactoryWithHorizontalCells()
public
static factoryWithHorizontalCells([mixed $cellCount = 1 ]) : mixed
Parameters
- $cellCount : mixed = 1
getClassName()
public
static getClassName() : string
Return values
stringgetCreatedAt()
public
getCreatedAt() : DateTime
Return values
DateTimegetCurrentDbState()
public
getCurrentDbState() : array<string|int, mixed>
Return values
array<string|int, mixed>getErrors()
Get Errors collections.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>getId()
public
getId() : mixed
getMapAttributes()
Returns the list of pair for mapping data and object properties.
public
static getMapAttributes() : array<string|int, mixed>
Key is field in DataManager, value is object property.
Return values
array<string|int, mixed>getMapReferenceAttributes()
Returns map of lazy loaded attributes of current model.
public
static getMapReferenceAttributes() : array<string|int, mixed>
supported relation types ONE_TO_MANY, MANY_TO_ONE, MANY_TO_MANY example: array( 'lazyLoadAttributeName_1' => array( 'type' => Common::ONE_TO_MANY, 'targetEntity' => TargetEntityClass::getClassName(), //inheritor of this class 'mappedBy' => 'targetEntityField', ), 'lazyLoadAttributeName_2' => array( 'type' => Common::MANY_TO_ONE, 'targetEntity' => TargetEntityClass::getClassName(), //inheritor of this class 'inveredBy' => '', 'join' => array( 'field' => array('thisFieldName', 'relationEntityFieldMame') ) ), 'lazyLoadAttributeName_1' => array( 'type' => Common::MANY_TO_MANY, 'targetEntity' => TargetEntityClass::getClassName(), //inheritor of this class 'join' => array( 'tableClassName' => TableClassName::getClassName //Supporting table ORM class name for connecting 2 entities 'column' => array(SUPPORTING_CONNECT_COLUMN => array('thisPrimaryFieldName', 'SUPPORTING_TABLE_APPROPRIATE_FIELD_NAME')), 'inverseColumn' => array(SUPPORTING_CONNECT_COLUMN => array('relationEntityPrimaryFieldName', 'SUPPORTING_TABLE_APPROPRIATE_FIELD_NAME')), ), ) )
Return values
array<string|int, mixed>getTableClassName()
Gets the fully qualified name of table class which belongs to current model.
public
static getTableClassName() : string|DataManager
Tags
Return values
string|DataManagergetUpdatedAt()
public
getUpdatedAt() : DateTime
Return values
DateTimeload()
public
static load(array<string|int, mixed>|ConditionTree $filter[, array<string|int, mixed> $with = array() ][, array<string|int, mixed> $order = array() ]) : static
Parameters
- $filter : array<string|int, mixed>|ConditionTree
-
Filter parameters.
- $with : array<string|int, mixed> = array()
-
Relation keys to load.
- $order : array<string|int, mixed> = array()
-
Order parameters.
Return values
staticloadAttribute()
public
loadAttribute(string $attributeName) : void
Parameters
- $attributeName : string
-
Attribute name to load to property from db.
loadById()
public
static loadById(mixed $id) : static
Parameters
- $id : mixed
-
Load entity by id.
Return values
staticsave()
public
save() : Model
Return values
ModelsetCreatedAt()
public
setCreatedAt(DateTime $createdAt) : void
Parameters
- $createdAt : DateTime
-
Record create time.
setId()
public
setId(mixed $id) : void
Parameters
- $id : mixed
-
Id property value.
setUpdatedAt()
public
setUpdatedAt(DateTime $updatedAt) : void
Parameters
- $updatedAt : DateTime
-
Record update time.