/** * Move forward to next result item * Implements Iterator * * @throws \Zend\LDAP\Exception */ public function next() { if (is_resource($this->_current)) { $this->_current = @ldap_next_entry($this->_ldap->getResource(), $this->_current); if ($this->_current === false) { $msg = $this->_ldap->getLastError($code); if ($code === LDAP\Exception::LDAP_SIZELIMIT_EXCEEDED) { // we have reached the size limit enforced by the server return; } else { if ($code > LDAP\Exception::LDAP_SUCCESS) { throw new LDAP\Exception($this->_ldap, 'getting next entry (' . $msg . ')'); } } } } }