1 | <?php |
||
14 | class SampleSource extends Component implements \IteratorAggregate, PaginatorAwareInterface, \Countable |
||
15 | { |
||
16 | use PaginatorTrait; |
||
17 | |||
18 | private $data = [ |
||
19 | 0 => [ |
||
20 | 'id' => 1, |
||
21 | 'active' => true, |
||
22 | 'name' => 'Anton', |
||
23 | 'balance' => 100 |
||
24 | ], |
||
25 | 1 => [ |
||
26 | 'id' => 2, |
||
27 | 'active' => false, |
||
28 | 'name' => 'John', |
||
29 | 'balance' => 200 |
||
30 | ], |
||
31 | 2 => [ |
||
32 | 'id' => 3, |
||
33 | 'active' => false, |
||
34 | 'name' => 'Bill', |
||
35 | 'balance' => 300 |
||
36 | ], |
||
37 | 3 => [ |
||
38 | 'id' => 4, |
||
39 | 'active' => false, |
||
40 | 'name' => 'William', |
||
41 | 'balance' => 400 |
||
42 | ], |
||
43 | 4 => [ |
||
44 | 'id' => 5, |
||
45 | 'active' => true, |
||
46 | 'name' => 'Bruce', |
||
47 | 'balance' => 500 |
||
48 | ] |
||
49 | ]; |
||
50 | |||
51 | /** |
||
52 | * @return int |
||
53 | */ |
||
54 | public function count() |
||
58 | |||
59 | /** |
||
60 | * @return \ArrayIterator |
||
61 | */ |
||
62 | public function getIterator() |
||
72 | } |