Filter/Doctrine/Expression/ExpressionBuilder.php
protected function convertTypeToMask($value, $type)
    {
        if ($this->forceCaseInsensitivity) {
            $value = $this->encoding ? mb_strtolower($value, $this->encoding) : mb_strtolower($value);
        }

        switch ($type) {
            case FilterOperands::STRING_STARTS:
                $value .= '%';
                break;

            case FilterOperands::STRING_ENDS:
                $value = '%' . $value;
                break;

            case FilterOperands::STRING_CONTAINS:
                $value = '%' . $value . '%';
                break;

            case FilterOperands::STRING_EQUALS:
                break;

            default:
                throw new \InvalidArgumentException('Wrong type constant in string like expression mapper');
        }

        return $value;
    }
protected function convertTypeToMask($value, $type)
    {
        if ($this->forceCaseInsensitivity) {
            $value = $this->encoding ? mb_strtolower($value, $this->encoding) : mb_strtolower($value);
        }

        switch ($type) {
            case FilterOperands::STRING_STARTS:
                $value .= '%';
                break;

            case FilterOperands::STRING_ENDS:
                $value = '%' . $value;
                break;

            case FilterOperands::STRING_CONTAINS:
                $value = '%' . $value . '%';
                break;

            case FilterOperands::STRING_EQUALS:
                break;

            default:
                throw new \InvalidArgumentException('Wrong type constant in string like expression mapper');
        }

        return $value;
    }
protected function convertTypeToMask ( $ value , $ type ) { if ( $ this -> forceCaseInsensitivity ) { $ value = $ this -> encoding ? mb_strtolower ( $ value , $ this -> encoding ) : mb_strtolower ( $ value ) ; } switch ( $ type ) { case FilterOperands :: STRING_STARTS : $ value .= '%' ; break ; case FilterOperands :: STRING_ENDS : $ value = '%' . $ value ; break ; case FilterOperands :: STRING_CONTAINS : $ value = '%' . $ value . '%' ; break ; case FilterOperands :: STRING_EQUALS : break ; default : throw new \ InvalidArgumentException ( 'Wrong type constant in string like expression mapper' ) ; } return $ value ; }
Prepare value for like operation

@param string $value
@param int    $type one of FilterOperands::STRING_*

@return string

@throws \InvalidArgumentException
Prepare value for like operation