1 | <?php |
||
47 | class RepositoryIterator implements RepositoryIteratorInterface |
||
48 | { |
||
49 | /** |
||
50 | * Object configuration |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $config; |
||
55 | /** |
||
56 | * Object stac |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $objectStack = []; |
||
61 | /** |
||
62 | * Day pointer |
||
63 | * |
||
64 | * @var \DateTime |
||
65 | */ |
||
66 | protected $dayPointer; |
||
67 | |||
68 | /** |
||
69 | * Constructor |
||
70 | * |
||
71 | * @param array $config Object configuration |
||
72 | */ |
||
73 | 5 | public function __construct(array $config) |
|
77 | |||
78 | /** |
||
79 | * Return the current object config |
||
80 | * |
||
81 | * @return array Object config |
||
82 | */ |
||
83 | 5 | public function current() |
|
87 | |||
88 | /** |
||
89 | * Forward the day pointer by a random period between 0 and 259200 seconds (= 3 days) |
||
90 | */ |
||
91 | 3 | public function next() |
|
95 | |||
96 | /** |
||
97 | * Return the day pointer |
||
98 | * |
||
99 | * @return \DateTime Day pointer |
||
100 | */ |
||
101 | 5 | public function key() |
|
105 | |||
106 | /** |
||
107 | * Return whether the current item is still valid |
||
108 | * |
||
109 | * @return bool |
||
110 | */ |
||
111 | 5 | public function valid() |
|
115 | |||
116 | /** |
||
117 | * Rewind the iterator and rebuild the object stack |
||
118 | */ |
||
119 | 5 | public function rewind() |
|
135 | } |
||
136 |