public function next()
{
if (!$this->isEnabled) {
return;
}
// If the size limit exceeds the page size, and the next page would exceed the limit, reduce the page size...
if ($this->sizeLimit && $this->resultNumber + $this->pageSize > $this->sizeLimit) {
$this->pageSize = $this->sizeLimit - $this->resultNumber;
}
if (!@ldap_control_paged_result($this->connection->getConnection(), $this->pageSize, false, $this->cookie)) {
throw new LdapConnectionException(sprintf('Unable to enable paged results: %s', $this->connection->getLastError()));
}
}