Hmm.. you probably want a custom expression (in stead of a function). I'm not 
sure if you can easily add a custom expression.

In theory it should be possible, because Doctrine uses a parser to convert DQL 
to an AST, and then to SQL. But unfortunately I don't know how :(

Maybe others on this list shed some light?

PS: One option I can think of is to use an Output Walker [2] to convert LIKE in 
DQL to ILIKE in SQL. So you still use LIKE in your DQL query, but set your 
Output Walker as hint when you want it to end up as ILIKE in SQL.

[2]: 
http://docs.doctrine-project.org/en/2.1/cookbook/dql-custom-walkers.html#modify-the-output-walker-to-generate-vendor-specific-sql

--  
Jasper N. Brouwer
(@jaspernbrouwer)


On 26 May 2014 at 12:54:49, Gianvito Pio ([email protected]) wrote:
> Ok, but actually I have to compose a very complex query and it would be
> better to be coherent between LIKE (case sensitive) and ILIKE (case
> insensitive) in such composition.
> As far as you know, is it possible to define a custom infix operator (as
> ILIKE)? I would prefer to perform the query as "field ILIKE value" and
> not as "ILIKE(field,value)".
>  
> Thank you


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to