A logical OR operator.
public bOr ( $op ) : |
||
Résultat |
/** * Adds a base 'bOr' operator for the convenience 'orWhere' method only if it does not already exist. * * @throws \LdapTools\Exception\LdapQueryException */ protected function addBaseOrIfNotExists() { if (!$this->baseOr) { $this->baseOr = $this->filterBuilder->bOr(); $this->operation->getFilter()->add($this->baseOr); } }
/** * @param bool $value * @return \LdapTools\Query\Operator\BaseOperator */ protected function getQueryOperator($value) { $fb = new FilterBuilder(); if ($value) { $operator = $fb->bAnd($fb->gte('accountExpires', '1'), $fb->lte('accountExpires', '9223372036854775806')); } else { $operator = $fb->bOr($fb->eq('accountExpires', '0'), $fb->eq('accountExpires', self::NEVER_EXPIRES)); } return $operator; }
/** * @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')); }
function it_should_convert_attributes_and_values_when_the_operators_contain_other_operators() { $this->collection->add($this->filter->eq('username', 'foo')); $this->collection->add($this->filter->bOr($this->filter->eq('created', new \DateTime('2016-01-01', new \DateTimeZone('America/New_York'))))); $this->toLdap()->toLdapFilter('user')->shouldBeEqualTo('(&(&(objectCategory=person)(objectClass=user))(|(whenCreated=20160101000000.0-0500))(sAMAccountName=foo))'); }