Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
paginator.php
1<?php
2
4
5class Paginator implements \IteratorAggregate
6{
8 private $request;
9
11 private $params;
12
17 public function __construct(
18 Request $request,
19 array $params
20 )
21 {
22 $this->request = $request;
23 $this->params = $params;
24 }
25
30 public function getIterator() : \Generator
31 {
32 do
33 {
34 $response = $this->request->send($this->params);
35
36 $next = $response instanceof PagingInterface && $this->params = $response->prepareRequestParams($this->params);
37
38 yield $response;
39 }
40 while($next);
41 }
42}
__construct(Request $request, array $params)
Definition paginator.php:17