| 1 | <?php |
||
| 9 | trait MappableTrait |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * The Entity's Attributes |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $attributes = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Method used by the mapper to set the object |
||
| 19 | * attribute raw values (hydration) |
||
| 20 | * |
||
| 21 | * @param array $attributes |
||
| 22 | * |
||
| 23 | * @return void |
||
| 24 | */ |
||
| 25 | public function setEntityAttributes(array $attributes) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Method used by the mapper to get the |
||
| 32 | * raw object's values. |
||
| 33 | * |
||
| 34 | * @return array |
||
| 35 | */ |
||
| 36 | public function getEntityAttributes() |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Method used by the mapper to set raw |
||
| 43 | * key-value pair |
||
| 44 | * |
||
| 45 | * @param string $key |
||
| 46 | * @param string $value |
||
| 47 | * |
||
| 48 | * @return void |
||
| 49 | */ |
||
| 50 | public function setEntityAttribute($key, $value) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Method used by the mapper to get single |
||
| 57 | * key-value pair |
||
| 58 | * |
||
| 59 | * @param string $key |
||
| 60 | * @return mixed|null |
||
| 61 | */ |
||
| 62 | public function getEntityAttribute($key) |
||
| 70 | } |
||
| 71 |