has() public method

Check to see if a specific attribute exists. Optionally check if it exists with a specific value.
public has ( string $attribute, mixed $value = null ) : boolean
$attribute string
$value mixed
return boolean
Ejemplo n.º 1
0
 /**
  * The DN attribute must be present to perform LDAP operations.
  *
  * @param LdapObject $ldapObject
  */
 protected function validateObject(LdapObject $ldapObject)
 {
     if (!$ldapObject->has('dn')) {
         throw new InvalidArgumentException('To persist/delete/move/restore a LDAP object it must have the DN attribute.');
     }
 }