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

lte() public method

A less-than-or-equal-to comparison.
public lte ( $attribute, $value ) : Comparison
$attribute
$value
return LdapTools\Query\Operator\Comparison
    public function lte($attribute, $value)
    {
        return new Comparison($attribute, Comparison::LTE, $value);
    }

Usage Example

 /**
  * @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;
 }