-
Notifications
You must be signed in to change notification settings - Fork 1
Model Helper
Sakya edited this page Nov 26, 2021
·
2 revisions
This model implement Lamians\Stdlib\ArraySerializableInterface
Any attribute in this model that has populate or getArrayCopy function will be call automatically by the parent
Filter function :
-
set<Attribute>use for filtering value before assigning value to attribute -
get<Attribute>use for filtering value before returning attribute value
When populate / getArrayCopy function is call from AbstractModel
- If filter function exist for given attribute call the filter function
- Else if the attribute implements ArraySerializableInterface call attribute populate / getArrayCopy ( nestable )
- Else if the attribute has populate / getArrayCopy function call the function ( nestable )
- Else assign / return the value directly to / from attribute
This model extend AbstractModel
Predefine attribute:
- tech_creation_date : database row creation time
- tech_modification_date : database row modification time
- tech_timezone : timezone use, default UTC. Remove from getArrayCopy function
Database Requirement:
A database table with tech_creation_date and tech_modification_date column is required.
The column usually is set by BEFORE INSERT trigger and BEFORE UPDATE trigger
- This model implement Lamians\Stdlib\ArraySerializableInterface
- This model does not extend AbstractModel
- Collection is an ArrayObject
- Collection has populate function so it will be populate automatically when nested inside AbstractModel
- Collection use ArrayObject builtin exchangeArray and getArrayCopy function