Go to Google Groups Home    doctrine-dev
Re: [doctrine-dev] Re: New DQL Criteria API

Roman Borschel <r.borsc...@gmx.net>

I only want to clarify what this discussion is about.

We have the Query class. It accepts full DQL strings. You can always  
build any DQL query through string concatenation.
The issue with that is just that *conditional* query construction (if  
parameter A set condition X, if parameter B, set condition B OR C)
is cumbersome using string concatenation.

That is what the QueryBuilder class should be useful for.

And what we're now wondering is what the best and safest way is to  
construct expressions with the QueryBuilder API.

It does add nothing in terms of functionality. Just a different way to  
construct queries that is more suitable if the construction is based  
on conditions.

Regards

Roman

On May 28, 2009, at 7:58 PM, Adam Huttler wrote:

> Possibility #1 is the most expressive and easiest to read, IMO. I  
> like the variant, even though it's more verbose, because it feels a  
> little more flexible.

> > -----Original Message-----
> > From: doctrine-dev@googlegroups.com [mailto:doctrine-
> > dev@googlegroups.com] On Behalf Of Guilherme Blanco
> > Sent: Thursday, May 28, 2009 1:55 PM
> > To: doctrine-dev@googlegroups.com
> > Subject: [doctrine-dev] New DQL Criteria API

> > Hi guys,

> > We're talking a lot about Doctrine 2.0 and this time I'm coming here
> > to talk about DQL changes.
> > String processing is something really weird, and we want to remove,
> > since it's extremely error-prone.

> > Basically the purpose of this email is about WHERE conditions.
> > We end up with a lot of possibilities, and we want all of you to  
> give
> > us suggestions about which way we should move to.
> > Here are the possibilities we came so far:
> > http://pastebin.com/f4f6c2aa0

> > If you have any other suggestions, include them here too.
> > We expect to find the simplest way to build a query without adding  
> too
> > much WTF factor inside.

> > So, what's your ideas?

> > Cheers,

> > --
> > Guilherme Blanco - Web Developer
> > CBC - Certified Bindows Consultant
> > Cell Phone: +55 (16) 9215-8480
> > MSN: guilhermebla...@hotmail.com
> > URL: http://blog.bisna.com
> > São Paulo - SP/Brazil