LdapTools\Query\Builder\FilterBuilder::notPresent PHP Method

notPresent() public method

Convenience method to check for the non-existence of an attribute.
public notPresent ( $attribute ) : bNot
$attribute
return LdapTools\Query\Operator\bNot
    public function notPresent($attribute)
    {
        return new bNot($this->present($attribute));
    }

Usage Example

 /**
  * @param bool $value
  * @return \LdapTools\Query\Operator\bOr|\LdapTools\Query\Operator\Comparison
  */
 protected function getQueryValue($value)
 {
     $fb = new FilterBuilder();
     return $value ? $fb->gte('lockoutTime', '1') : $fb->bOr($fb->notPresent('lockoutTime'), $fb->eq('lockoutTime', '0'));
 }