1 | <?php |
||
13 | class Entity implements EntityInterface |
||
14 | { |
||
15 | /** |
||
16 | * Table name |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $table; |
||
21 | |||
22 | /** |
||
23 | * Data array only |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $data; |
||
28 | |||
29 | /** |
||
30 | * Associative array ( field => value ) |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $identifier; |
||
35 | |||
36 | /** |
||
37 | * Many to many relations array |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $manyToMany; |
||
42 | |||
43 | /** |
||
44 | * One to many relations array |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $oneToMany; |
||
49 | |||
50 | /** |
||
51 | * Many to one relations array |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $manyToOne; |
||
56 | |||
57 | /** |
||
58 | * One to one relations array |
||
59 | * |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $oneToOne; |
||
63 | |||
64 | /** |
||
65 | * Constructor, set the attributes from array |
||
66 | * |
||
67 | * @param array $data entity prepared data from DataTransformer |
||
68 | */ |
||
69 | 7 | public function __construct(array $data) |
|
98 | |||
99 | /** |
||
100 | * @param array $related |
||
101 | */ |
||
102 | 4 | private function initializeRelated($related) |
|
117 | |||
118 | /** |
||
119 | * Get the table name |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | 3 | public function getTable() |
|
127 | |||
128 | /** |
||
129 | * Get the entity identifier => value array |
||
130 | * |
||
131 | * @return array |
||
132 | */ |
||
133 | 2 | public function getIdentifier() |
|
137 | |||
138 | /** |
||
139 | * Set the entity identifier array |
||
140 | * |
||
141 | * @param array $identifier entity identifier associative array (id => value) |
||
142 | * |
||
143 | * @return self |
||
144 | */ |
||
145 | 1 | public function setIdentifier(array $identifier) |
|
151 | |||
152 | /** |
||
153 | * Get the entity data set |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | 1 | public function getData() |
|
161 | |||
162 | /** |
||
163 | * Get the entity manyToOne relations array |
||
164 | * |
||
165 | * @return array |
||
166 | */ |
||
167 | 1 | public function getManyToOneRelations() |
|
171 | |||
172 | /** |
||
173 | * Get the entity manyToMany relations array |
||
174 | * |
||
175 | * @return array |
||
176 | */ |
||
177 | 1 | public function getManyToManyRelations() |
|
181 | |||
182 | /** |
||
183 | * Get the entity oneToMany relations array |
||
184 | * |
||
185 | * @return array |
||
186 | */ |
||
187 | 1 | public function getOneToManyRelations() |
|
191 | |||
192 | /** |
||
193 | * Get the entity oneToOne relations array |
||
194 | * |
||
195 | * @return array |
||
196 | */ |
||
197 | 1 | public function getOneToOneRelations() |
|
201 | |||
202 | /** |
||
203 | * Merge new data on current entity data |
||
204 | * |
||
205 | * @param array $data data set to merge |
||
206 | * |
||
207 | * @return self |
||
208 | */ |
||
209 | 1 | public function addDataSet(array $data) |
|
215 | |||
216 | /** |
||
217 | * Get an entity property from data |
||
218 | * |
||
219 | * @param string $property data index to return |
||
220 | * |
||
221 | * @return string |
||
222 | */ |
||
223 | 2 | public function getProperty($property) |
|
232 | } |
||
233 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..