/** * Rewind the Iterator to the first result item * Implements Iterator * * @throws \Zend\LDAP\Exception */ public function rewind() { if (is_resource($this->_resultId)) { $this->_current = @ldap_first_entry($this->_ldap->getResource(), $this->_resultId); if ($this->_current === false && $this->_ldap->getLastErrorCode() > LDAP\Exception::LDAP_SUCCESS) { throw new LDAP\Exception($this->_ldap, 'getting first entry'); } } }