1 | <?php |
||
7 | class Entity implements \Tarantool\Mapper\Contracts\Entity |
||
8 | { |
||
9 | private $id; |
||
|
|||
10 | |||
11 | 65 | public function __construct(array $data = null) |
|
12 | { |
||
13 | 65 | if ($data) { |
|
14 | 65 | $this->update($data); |
|
15 | 65 | } |
|
16 | 65 | } |
|
17 | |||
18 | 65 | public function update($data) |
|
19 | { |
||
20 | 65 | foreach ($data as $k => $v) { |
|
21 | 65 | $this->$k = $v; |
|
22 | 65 | } |
|
23 | 65 | } |
|
24 | |||
25 | 65 | public function __set($key, $value) |
|
33 | |||
34 | 65 | public function __get($key) |
|
40 | |||
41 | /** |
||
42 | * @return int |
||
43 | */ |
||
44 | 65 | public function getId() |
|
48 | |||
49 | /** |
||
50 | * @return Entity |
||
51 | */ |
||
52 | 65 | public function setId($id) |
|
58 | |||
59 | /** |
||
60 | * @return array |
||
61 | */ |
||
62 | 64 | public function toArray($recursive = false) |
|
74 | |||
75 | 1 | public function __call($name, $params) |
|
88 | } |
||
89 |
This check marks private properties in classes that are never used. Those properties can be removed.