Perform a bitwise AND operation against an attribute.
public bitwiseAnd ( string $attribute, integer $value ) : |
||
$attribute | string | |
$value | integer | |
return |
/** * 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); }
/** * 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); }