1 | <?php |
||
15 | abstract class AbstractEntity implements EntityInterface |
||
16 | { |
||
17 | use Property; |
||
18 | |||
19 | const ENTITY_TYPE = 'AbstractEntity'; |
||
20 | |||
21 | protected $parent; |
||
22 | |||
23 | protected $builtInEntities = []; |
||
24 | |||
25 | protected $supportedProperties = []; |
||
26 | |||
27 | /** |
||
28 | * Constructs extended entity's class and sets properties from array if passed. |
||
29 | * |
||
30 | * @param array $data Array with properties to set |
||
31 | */ |
||
32 | public function __construct(array $data = []) |
||
41 | |||
42 | /** |
||
43 | * Returns entity type |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getEntityType() |
||
51 | |||
52 | /** |
||
53 | * Sets parent entity |
||
54 | * |
||
55 | * @param EntityInterface $parent Parent entity |
||
56 | */ |
||
57 | public function setParent(EntityInterface $parent = null) |
||
61 | |||
62 | /** |
||
63 | * Returns parent entity |
||
64 | * |
||
65 | * @return AbstractEntity |
||
66 | */ |
||
67 | public function getParent() |
||
71 | |||
72 | /** |
||
73 | * Initialises built-in entity classes if any. |
||
74 | * |
||
75 | * @param array $data Array with data to pass to newly created instance of built-in entity |
||
76 | */ |
||
77 | protected function initBuiltInEntities(array $data) |
||
101 | } |
||
102 |