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
 /**
  * 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);
 }
Esempio n. 2
0
 /**
  * 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();
     $bit = abs($this->getBitForAttribute($this->getAttribute()));
     $operator = $fb->bitwiseAnd('groupType', (string) $bit);
     $value = $this->shouldInvertValue() ? !$value : $value;
     return $value ? $operator : $fb->bNot($operator);
 }