Total Complexity | 7 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Iterator implements \Iterator { |
||
6 | private $array; |
||
7 | private $pk; |
||
8 | private $iterator = 0; |
||
9 | |||
10 | public function __construct(array $array, $pk) { |
||
13 | } |
||
14 | |||
15 | public function current() { |
||
17 | } |
||
18 | |||
19 | public function key() { |
||
20 | if (count($this->pk) == 1) { |
||
21 | $pk = end($this->pk); |
||
22 | return $this->array[$this->iterator]->$pk; |
||
23 | } |
||
24 | else { |
||
25 | $current = $this->current(); |
||
26 | return array_map(function($pkName) use ($current) { |
||
27 | return $current->$pkName; |
||
28 | }, $this->pk); |
||
29 | } |
||
30 | } |
||
31 | |||
32 | public function next() { |
||
34 | } |
||
35 | |||
36 | public function valid() { |
||
38 | } |
||
39 | |||
40 | public function rewind() { |
||
42 | } |
||
43 | } |
||
44 |