Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Query\Pagination; |
| 4 | |
| 5 | use LdapRecord\LdapInterface; |
| 6 | |
| 7 | /** |
| 8 | * @deprecated since v2.5.0 |
| 9 | */ |
| 10 | class DeprecatedPaginator extends AbstractPaginator |
| 11 | { |
| 12 | /** |
| 13 | * The pagination cookie. |
| 14 | * |
| 15 | * @var string |
| 16 | */ |
| 17 | protected $cookie = ''; |
| 18 | |
| 19 | /** |
| 20 | * @inheritdoc |
| 21 | */ |
| 22 | protected function fetchCookie() |
| 23 | { |
| 24 | return $this->cookie; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @inheritdoc |
| 29 | */ |
| 30 | protected function prepareServerControls() |
| 31 | { |
| 32 | $this->cookie = ''; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @inheritdoc |
| 37 | */ |
| 38 | protected function applyServerControls(LdapInterface $ldap) |
| 39 | { |
| 40 | $ldap->controlPagedResult($this->perPage, $this->isCritical, $this->cookie); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @inheritdoc |
| 45 | */ |
| 46 | protected function updateServerControls(LdapInterface $ldap, $resource) |
| 47 | { |
| 48 | $ldap->controlPagedResultResponse($resource, $this->cookie); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * @inheritdoc |
| 53 | */ |
| 54 | protected function resetServerControls(LdapInterface $ldap) |
| 55 | { |
| 56 | $ldap->controlPagedResult(); |
| 57 | } |
| 58 | } |