/** @return peer.ldap.LDAPEntry */ protected function newInstance($dn, $attributes) { return LDAPEntry::create($dn, $attributes); }
/** * Read an entry * * @param peer.ldap.LDAPEntry entry specifying the dn * @return peer.ldap.LDAPEntry entry * @throws lang.IllegalArgumentException * @throws peer.ldap.LDAPException */ public function read(LDAPEntry $entry) { $res = ldap_read($this->_hdl, $entry->getDN(), 'objectClass=*', array(), false, 0); if (LDAP_SUCCESS != ldap_errno($this->_hdl)) { throw new LDAPException('Read "' . $entry->getDN() . '" failed', ldap_errno($this->_hdl)); } $entry = ldap_first_entry($this->_hdl, $res); return LDAPEntry::create(ldap_get_dn($this->_hdl, $entry), ldap_get_attributes($this->_hdl, $entry)); }
/** * Read an entry * * @param peer.ldap.LDAPEntry entry specifying the dn * @return peer.ldap.LDAPEntry entry * @throws lang.IllegalArgumentException * @throws peer.ldap.LDAPException */ public function read(LDAPEntry $entry) { $res = ldap_read($this->handle, $entry->getDN(), 'objectClass=*', [], false, 0); if (LDAP_SUCCESS != ldap_errno($this->handle)) { throw $this->error('Read "' . $entry->getDN() . '" failed'); } $entry = ldap_first_entry($this->handle, $res); return LDAPEntry::create(ldap_get_dn($this->handle, $entry), ldap_get_attributes($this->handle, $entry)); }