public function has($attribute, $value = null) { if (!array_key_exists(MBString::strtolower($attribute), MBString::array_change_key_case($this->attributes))) { return false; } return is_null($value) ?: $this->attributeHasValue($attribute, $value); }
/** * 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.'); } }