$datamap
$datamap :
Maps names used in sets and gets against unique names within the class, allowing independence from database column names.
Example: $datamap = [ 'db_name' => 'class_name' ];
Entity encapsulation, for use with CodeIgniter\Model
fill(array $data = null) : \CodeIgniter\Entity
Takes an array of key/value pairs and sets them as class properties, using any `setCamelCasedProperty()` methods that may or may not exist.
array | $data |
toArray(boolean $onlyChanged = false, boolean $cast = true) : array
General method that will return all public and protected values of this entity as an array. All values are accessed through the __get() magic method so will have any casts, etc applied to them.
boolean | $onlyChanged | If true, only return values that have changed since object creation |
boolean | $cast | If true, properties will be casted. |
__set(string $key, null $value = null) : $this
Magic method to all protected/private class properties to be easily set, either through a direct access or a `setCamelCasedProperty()` method.
Examples:
$this->my_property = $p;
$this->setMyProperty() = $p;
string | $key | |
null | $value |