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

bitwiseAnd() public method

Perform a bitwise AND operation against an attribute.
public bitwiseAnd ( string $attribute, integer $value ) : MatchingRule
$attribute string
$value integer
return LdapTools\Query\Operator\MatchingRule
    public function bitwiseAnd($attribute, $value)
    {
        return new MatchingRule($attribute, MatchingRuleOid::BIT_AND, $value);
    }

Usage Example

 /**
  * Transform a bool value into the bitwise operator needed for the LDAP filter.
  * 
  * @param bool $value
  * @return \LdapTools\Query\Operator\BaseOperator
  */
 protected function getQueryOperator($value)
 {
     $fb = new FilterBuilder();
     $mappedValue = $this->getArrayValue($this->getOptions()['uacMap'], $this->getAttribute());
     $operator = $fb->bitwiseAnd('userAccountControl', $mappedValue);
     $value = $this->shouldInvertValue() ? !$value : $value;
     return $value ? $operator : $fb->bNot($operator);
 }
All Usage Examples Of LdapTools\Query\Builder\FilterBuilder::bitwiseAnd