1 | <?php |
||
14 | class EntityCollection extends ArrayCollection implements NormalizableInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var PropertyAccessorInterface |
||
18 | */ |
||
19 | private static $propertyAccessor; |
||
20 | |||
21 | /** |
||
22 | * Create and returns local property accessor. |
||
23 | * |
||
24 | * @return PropertyAccessorInterface |
||
25 | */ |
||
26 | private function getPropertyAccessor() |
||
32 | |||
33 | /** |
||
34 | * return collectionned entity class. |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getEntityClass() |
||
44 | |||
45 | /** |
||
46 | * @see NormalizableInterface::getScopes() |
||
47 | */ |
||
48 | public static function getScopes() |
||
52 | |||
53 | /** |
||
54 | * @see NormalizableInterface::normalize() |
||
55 | */ |
||
56 | 6 | public function normalize($scope = 'default') |
|
65 | |||
66 | /** |
||
67 | * @see NormalizableInterface::denormalize() |
||
68 | */ |
||
69 | public function denormalize(array $data) |
||
81 | |||
82 | /** |
||
83 | * @see SerializableInterface::serialize() |
||
84 | */ |
||
85 | public function serialize($scope = 'default', PropertyAccessorInterface $propertyAccessor = null) |
||
91 | |||
92 | /** |
||
93 | * @see SerializableInterface::deserialize() |
||
94 | */ |
||
95 | public function deserialize(array $data, PropertyAccessorInterface $propertyAccessor = null) |
||
101 | |||
102 | /** |
||
103 | * filter given collection on given fields. |
||
104 | * |
||
105 | * @param array $filters |
||
106 | * |
||
107 | * @return EntityCollection |
||
108 | */ |
||
109 | public function search(array $filters) |
||
124 | |||
125 | /** |
||
126 | * extract the first $length elements from collection. |
||
127 | * |
||
128 | * @param int $length |
||
129 | * |
||
130 | * @return EntityCollection |
||
131 | */ |
||
132 | public function chunk($length) |
||
138 | |||
139 | /** |
||
140 | * @see ArrayCollection::slice() |
||
141 | * |
||
142 | * @return EntityCollection |
||
143 | */ |
||
144 | public function cslice($offset, $length = null) |
||
148 | |||
149 | /** |
||
150 | * Sort collection with given closure. |
||
151 | * |
||
152 | * @param \Closure $p |
||
153 | * |
||
154 | * @return EntityCollection |
||
155 | */ |
||
156 | public function sort(\Closure $p) |
||
166 | |||
167 | /** |
||
168 | * Reduce collection with given closure. |
||
169 | * |
||
170 | * @link http://php.net/manual/en/function.array-reduce.php |
||
171 | * |
||
172 | * @param \Closure $p |
||
173 | * @param mixed $initialValue |
||
174 | * |
||
175 | * @return mixed |
||
176 | */ |
||
177 | public function reduce(\Closure $p, $initialValue = null) |
||
181 | |||
182 | /** |
||
183 | * reads and returns value of given field into given element. |
||
184 | * |
||
185 | * @param CollectionableInterface $element |
||
186 | * @param string $field |
||
187 | * |
||
188 | * @return mixed |
||
189 | */ |
||
190 | private function getFieldValue(CollectionableInterface $element, $field) |
||
194 | |||
195 | /** |
||
196 | * index collection by given object field. |
||
197 | * |
||
198 | * @param string $field |
||
199 | * |
||
200 | * @return EntityCollection |
||
201 | */ |
||
202 | public function indexBy($field) |
||
216 | |||
217 | /** |
||
218 | * Return value of inner objects given property as an array. |
||
219 | * |
||
220 | * This is an object version of array_column() method. |
||
221 | * @link http://php.net/manual/fr/function.array-column.php |
||
222 | * |
||
223 | * @param string $column |
||
224 | * |
||
225 | * @return array |
||
226 | */ |
||
227 | public function column($column) |
||
236 | |||
237 | /** |
||
238 | * Create a flattened view of collection as a key value array. |
||
239 | * |
||
240 | * @param string $indexColumn |
||
241 | * @param string $valueColumn |
||
242 | * |
||
243 | * @return array |
||
244 | */ |
||
245 | public function flatten($indexColumn, $valueColumn) |
||
256 | |||
257 | /** |
||
258 | * Returns a string representation of given column values. |
||
259 | * |
||
260 | * @param string $column |
||
261 | * @param string $slug |
||
262 | * |
||
263 | * @return string |
||
264 | */ |
||
265 | public function display($column, $slug = '", "', $format = '["%s"]') |
||
272 | } |
||
273 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.