/**
* Constructor.
*
* @param resource $search Search result identifier.
* @param Horde_Ldap|resource $ldap Horde_Ldap object or a LDAP link
* resource
* @param array $attributes The searched attribute names,
* see {@link $_searchedAttrs}.
*/
public function __construct($search, $ldap, $attributes = array())
{
$this->setSearch($search);
if ($ldap instanceof Horde_Ldap) {
$this->_ldap = $ldap;
$this->setLink($this->_ldap->getLink());
} else {
$this->setLink($ldap);
}
$this->_errorCode = @ldap_errno($this->_link);
if (is_array($attributes) && !empty($attributes)) {
$this->_searchedAttrs = $attributes;
}
}