| 1 | <?php |
||
| 7 | class Model |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Allow data to be filled via the constructor. |
||
| 11 | * |
||
| 12 | * @param iterable $data |
||
| 13 | */ |
||
| 14 | 32 | public function __construct($data = null) |
|
| 15 | { |
||
| 16 | 32 | if (isset($data)) { |
|
| 17 | 27 | $this->fill($data); |
|
| 18 | } |
||
| 19 | 32 | } |
|
| 20 | |||
| 21 | /** |
||
| 22 | * Get an associative array of the attributes. |
||
| 23 | * |
||
| 24 | * @return array |
||
| 25 | */ |
||
| 26 | 31 | public function getAttributes() |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Get the names of the attributes on this model. |
||
| 33 | * |
||
| 34 | * @return array |
||
| 35 | */ |
||
| 36 | 1 | public function getAttributeNames() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Populate the model with the supplied data. |
||
| 43 | * |
||
| 44 | * @param iterable $data |
||
| 45 | * @return $this |
||
| 46 | * @throws InvalidPropertyException |
||
| 47 | */ |
||
| 48 | 30 | public function fill($data) |
|
| 60 | } |
||
| 61 |