1 | <?php |
||
12 | abstract class Wrapper implements InternallyMappable |
||
13 | { |
||
14 | /** |
||
15 | * Original Entity Object |
||
16 | * |
||
17 | * @var mixed |
||
18 | */ |
||
19 | protected $entity; |
||
20 | |||
21 | /** |
||
22 | * Corresponding EntityMap |
||
23 | * |
||
24 | * @var \Analogue\ORM\EntityMap |
||
25 | */ |
||
26 | protected $entityMap; |
||
27 | |||
28 | /** |
||
29 | * Wrapper constructor. |
||
30 | * @param $entity |
||
31 | * @param $entityMap |
||
32 | */ |
||
33 | public function __construct($entity, $entityMap) |
||
34 | { |
||
35 | $this->entity = $entity; |
||
36 | $this->entityMap = $entityMap; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Return the wrapped entity class |
||
41 | * |
||
42 | * @return mixed |
||
43 | */ |
||
44 | public function getEntityClass() |
||
48 | |||
49 | /** |
||
50 | * Returns the wrapped entity |
||
51 | * |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public function getObject() |
||
58 | |||
59 | /** |
||
60 | * Returns the wrapped entity's map |
||
61 | * |
||
62 | * @return mixed |
||
63 | */ |
||
64 | public function getMap() |
||
68 | |||
69 | /** |
||
70 | * Set the lazyloading proxies on the wrapped entity objet |
||
71 | * |
||
72 | * @return void |
||
73 | */ |
||
74 | public function setProxies() |
||
97 | |||
98 | /** |
||
99 | * @param string $key |
||
100 | * @param string $value |
||
101 | * @return mixed |
||
102 | */ |
||
103 | abstract public function setEntityAttribute($key, $value); |
||
104 | |||
105 | /** |
||
106 | * @param string $key |
||
107 | * @return mixed |
||
108 | */ |
||
109 | abstract public function getEntityAttribute($key); |
||
110 | |||
111 | /** |
||
112 | * @param array $attributes |
||
113 | * @return mixed |
||
114 | */ |
||
115 | abstract public function setEntityAttributes(array $attributes); |
||
116 | |||
117 | /** |
||
118 | * @return mixed |
||
119 | */ |
||
120 | abstract public function getEntityAttributes(); |
||
121 | |||
122 | /** |
||
123 | * @param string $key |
||
124 | * @return mixed |
||
125 | */ |
||
126 | abstract public function hasAttribute($key); |
||
127 | } |
||
128 |