Search\Model\Filter\Boolean::process PHP Method

process() public method

Check if a value is truthy/falsy and pass as condition.
public process ( ) : void
return void
    public function process()
    {
        if ($this->skip()) {
            return;
        }
        $value = $this->value();
        if (!is_scalar($value)) {
            return;
        }
        if (is_string($value)) {
            $value = strtolower($value);
        }
        $bool = null;
        if (in_array($value, $this->config('truthy'), true)) {
            $bool = true;
        } elseif (in_array($value, $this->config('falsy'), true)) {
            $bool = false;
        }
        if ($bool !== null) {
            $this->query()->andWhere([$this->field() => $bool]);
        }
    }
Boolean