1 | <?php |
||
11 | abstract class AbstractModel implements ArraySerializableInterface, \JsonSerializable |
||
12 | { |
||
13 | /** |
||
14 | * Used to map virtual to real fields |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $fieldMapping = []; |
||
19 | |||
20 | /** |
||
21 | * Populates this object from an array of data |
||
22 | * |
||
23 | * @param array $data |
||
24 | */ |
||
25 | 5 | public function fromArray(array $data) |
|
41 | |||
42 | /** |
||
43 | * Returns a copy data array of this object |
||
44 | * |
||
45 | * @return array |
||
46 | */ |
||
47 | 1 | public function toArray() |
|
51 | |||
52 | /** |
||
53 | * (PHP 5 >= 5.4.0)<br/> |
||
54 | * Specify data which should be serialized to JSON |
||
55 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
56 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
57 | * which is a value of any type other than a resource. |
||
58 | */ |
||
59 | 2 | public function jsonSerialize() |
|
63 | } |
||
64 |