1 | <?php |
||
20 | abstract class Collection extends \ArrayIterator |
||
21 | { |
||
22 | /** |
||
23 | * Returns first element in Collection |
||
24 | * @return mixed |
||
25 | */ |
||
26 | public function first() |
||
34 | |||
35 | /** |
||
36 | * Returns first key in Collection |
||
37 | * @return mixed |
||
38 | */ |
||
39 | protected function getFirstKey() |
||
47 | |||
48 | /** |
||
49 | * Returns keys of elements in Collection |
||
50 | */ |
||
51 | public function getKeys() |
||
61 | |||
62 | /** |
||
63 | * Creates nested Collection for each group. |
||
64 | * $func closure needs to return unique value for each group. |
||
65 | * @param \Closure $func |
||
66 | * @return Collection |
||
67 | */ |
||
68 | protected function groupBy(\Closure $func) |
||
85 | |||
86 | /** |
||
87 | * Checks whether Collection has something. |
||
88 | * Based on value returned by $func Closure. |
||
89 | * @param \Closure $func |
||
90 | * @return bool |
||
91 | */ |
||
92 | protected function has(\Closure $func) |
||
102 | } |
||
103 |