backend\models\OrderSearch::_addDigitalFilter PHP Method

_addDigitalFilter() protected method

protected _addDigitalFilter ( $query, $attribute )
    protected function _addDigitalFilter($query, $attribute)
    {
        $pattern = '/^(>|>=|<|<=|=)(\\d*\\.?\\d+)$/';
        if (preg_match($pattern, $this->{$attribute}, $matches) === 1) {
            $query->andFilterWhere([$matches[1], $attribute, $matches[2]]);
        } else {
            $query->andFilterWhere(['like', $attribute, $this->{$attribute}]);
        }
    }