@@ 165-178 (lines=14) @@ | ||
162 | * Method returns first [[visibleCount]] items from [[data]]. |
|
163 | * @return array |
|
164 | */ |
|
165 | protected function getVisibleItems() |
|
166 | { |
|
167 | if (count($this->data) <= $this->visibleCount) { |
|
168 | return $this->data; |
|
169 | } |
|
170 | $visible = []; |
|
171 | $iterator = (new ArrayObject($this->data))->getIterator(); |
|
172 | while (count($visible) < $this->visibleCount && $iterator->valid()) { |
|
173 | $visible[] = $iterator->current(); |
|
174 | $iterator->next(); |
|
175 | } |
|
176 | ||
177 | return $visible; |
|
178 | } |
|
179 | ||
180 | /** |
|
181 | * Method returns all items from [[data]], skipping first [[visibleCount]]. |
|
@@ 184-197 (lines=14) @@ | ||
181 | * Method returns all items from [[data]], skipping first [[visibleCount]]. |
|
182 | * @return array |
|
183 | */ |
|
184 | protected function getSpoiledItems() |
|
185 | { |
|
186 | if (count($this->data) <= $this->visibleCount) { |
|
187 | return []; |
|
188 | } |
|
189 | $spoiled = []; |
|
190 | $iterator = (new ArrayObject($this->data))->getIterator(); |
|
191 | $iterator->seek($this->visibleCount); |
|
192 | while ($iterator->valid()) { |
|
193 | $spoiled[] = $iterator->current(); |
|
194 | $iterator->next(); |
|
195 | } |
|
196 | ||
197 | return $spoiled; |
|
198 | } |
|
199 | ||
200 | /** |