Applies FilterIterator condition imitating the sql LIKE operator - $field LIKE %$value% | $value% | %$value.

@param string $field
@param string $value

@return $this
328235
public function like($field, $value)
    {
        $this->generator = new \CallbackFilterIterator($this->generator, function ($row) use ($field, $value) {

            // skip row. does not have field at all
            if (!isset($row[$field])) {
                return false;
            }

            $clean_value = trim(trim($value), '%');
            // the row field exists check the position of th "%"(s)
            switch ($value) {
                // case "%str%"
                case substr($value, -1, 1) == '%' && substr($value, 0, 1) == '%':
                    return strpos($row[$field], $clean_value) !== false;
                    break;
                // case "str%"
                case substr($value, -1, 1) == '%':
                    return substr($row[$field], 0, strlen($clean_value)) === $clean_value;
                    break;
                // case "%str"
                case substr($value, 0, 1) == '%':
                    return substr($row[$field], -strlen($clean_value)) === $clean_value;
                    break;
            }

            return false;
        });

        return $this;
    }
914166
public function whereStartsWith($field, $value, $length = null)
    {
        if ($value === '') {
            return $this;
        }

        if ($length === null) {
            return $this->_whereLike($field, '^' . $value);
        } else {
            return $this->_whereLike($field, '^' . str_pad($value, $length, '.') . '$');
        }
    }
1044087
public function whereNotLike($expr, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereNotLike($expr, $value);
        }

        return $this;
    }
346017
public function fieldValue($field, $value)
    {
        if (!in_array($field, $this->supports)) {
            $this->supports[ ] = $field;
        }
        $this->values[ $field ] = $value;

        return $this;
    }
4627
public TResult queryForLike(String fieldName, Object value) {
		return queryForLike(fieldName, value, null, null, null);
	}
466850
public function eq($field, $value) {
        if (is_array($value)) {
            $this->in($field, $value);

        } else if ($value === null) {
            $this->null($field);

        } else {
            $this->add($field, '=', $value);
        }

        return $this;
    }
969729
public function where($field, $value)
    {
        if (!isset($this->_expression[$field]) || !is_array($value) || !is_array($this->_expression[$field])) {
            $this->_expression[$field] = $value;
        } else {
            $this->_expression[$field] = array_merge_recursive($this->_expression[$field], $value);
        }

        return $this;
    }
1202667
public function lt($field, $value)
    {
        if(!$value instanceof Part) {
            $value = $this->buildPart($value);
        }
        return new Expr\ComparisonExpression($field, $value, Expr\ComparisonExpression::LT);
    }
836529
public static function like($field, $value, $format = Like::CONTAINS, $dqlAlias = null)
    {
        return new Like($field, $value, $format, $dqlAlias);
    }
1165424
public function set_filter($field,$value=false,$operation=false){
		if ($value === false)
			array_push($this->filters,$field);
		else
			array_push($this->filters,array("name"=>$field,"value"=>$value,"operation"=>$operation));
	}
626884
public function set($field, $value) {
        $parser = $this->getParser($field);
        $this->_properties[$field] = $parser->parse($value);
        return $this;
    }
749964
public function where($field, $operator, $value = null)
    {
        if (is_null($value)) {
            $value    = $operator;
            $operator = '=';
        }

        return $this->filter(function ($data) use ($field, $operator, $value) {
            if (strpos($field, '.')) {
                list($field, $relation) = explode('.', $field);

                $result = isset($data[$field][$relation]) ? $data[$field][$relation] : null;
            } else {
                $result = isset($data[$field]) ? $data[$field] : null;
            }

            switch ($operator) {
                case '===':
                    return $result === $value;
                case '!==':
                    return $result !== $value;
                case '!=':
                case '<>':
                    return $result != $value;
                case '>':
                    return $result > $value;
                case '>=':
                    return $result >= $value;
                case '<':
                    return $result < $value;
                case '<=':
                    return $result <= $value;
                case 'like':
                    return is_string($result) && false !== strpos($result, $value);
                case 'not like':
                    return is_string($result) && false === strpos($result, $value);
                case 'in':
                    return is_scalar($result) && in_array($result, $value, true);
                case 'not in':
                    return is_scalar($result) && !in_array($result, $value, true);
                case 'between':
                    list($min, $max) = is_string($value) ? explode(',', $value) : $value;
                    return is_scalar($result) && $result >= $min && $result <= $max;
                case 'not between':
                    list($min, $max) = is_string($value) ? explode(',', $value) : $value;
                    return is_scalar($result) && $result > $max || $result < $min;
                case '==':
                case '=':
                default:
                    return $result == $value;
            }
        });
    }
1151384
public function condition($field, $value = NULL, $operator = NULL)
    {
        $this->condition->condition($field, $value, $operator);
        return $this;
    }
334024
public function whereNotStartsWith($field, $value, $length = null)
    {
        if ($value === '') {
            return $this;
        }

        if ($length === null) {
            return $this->_whereNotLike($field, '^' . $value);
        } else {
            return $this->_whereNotLike($field, '^' . str_pad($value, $length, '.') . '$');
        }
    }
775138
public function whereNotContains($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereNotContains($field, $value);
        }

        return $this;
    }
672559
public function wildcard($field, $value, $boost = 1.0)
    {
        $query = new WildcardQuery($field, $value, ['boost' => $boost]);

        $this->append($query);

        return $this;
    }
605907
public function addFilter($field, $value, $operator= '=')
    {
        $this->filter[] = [
          'field' => $field,
          'value' => $value,
          'operator' => $operator,
        ];
        
        return $this;
    }