1 | <?php |
||
25 | abstract class FlexibleContainer implements FlexibleEntityInterface, \IteratorAggregate |
||
26 | { |
||
27 | use StatefulEntityTrait; |
||
28 | |||
29 | use ModifiedColumnEntityTrait; |
||
30 | |||
31 | protected $container = []; |
||
32 | |||
33 | /** |
||
34 | * hydrate |
||
35 | * |
||
36 | * @see FlexibleEntityInterface |
||
37 | */ |
||
38 | public function hydrate(array $values) |
||
44 | |||
45 | /** |
||
46 | * fields |
||
47 | * |
||
48 | * Return the fields array. If a given field does not exist, an exception |
||
49 | * is thrown. |
||
50 | * |
||
51 | * @throws \InvalidArgumentException |
||
52 | * @see FlexibleEntityInterface |
||
53 | */ |
||
54 | public function fields(array $fields = null) |
||
78 | |||
79 | |||
80 | /** |
||
81 | * extract |
||
82 | * |
||
83 | * @see FlexibleEntityInterface |
||
84 | */ |
||
85 | public function extract() |
||
89 | |||
90 | /** |
||
91 | * getIterator |
||
92 | * |
||
93 | * @see FlexibleEntityInterface |
||
94 | */ |
||
95 | public function getIterator() |
||
99 | |||
100 | /** |
||
101 | * __call |
||
102 | * |
||
103 | * Allows dynamic methods getXxx, setXxx, hasXxx or clearXxx. |
||
104 | * |
||
105 | * @access public |
||
106 | * @throws ModelException if method does not exist. |
||
107 | * @param mixed $method |
||
108 | * @param mixed $arguments |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function __call($method, $arguments) |
||
135 | |||
136 | /** |
||
137 | * checkAttribute |
||
138 | * |
||
139 | * Check if the attribute exist. Throw an exception if not. |
||
140 | * |
||
141 | * @access protected |
||
142 | * @param string $attribute |
||
143 | * @return FlexibleContainer $this |
||
144 | * @throws ModelException |
||
145 | */ |
||
146 | protected function checkAttribute($attribute) |
||
160 | |||
161 | /** |
||
162 | * extractMethodName |
||
163 | * |
||
164 | * Get container field name from method name. |
||
165 | * It returns an array with the operation (get, set, etc.) as first member |
||
166 | * and the name of the attribute as second member. |
||
167 | * |
||
168 | * @access protected |
||
169 | * @param string $argument |
||
170 | * @return array |
||
171 | * @throws ModelException |
||
172 | */ |
||
173 | protected function extractMethodName($argument) |
||
183 | } |
||
184 |