Skip to content

QueryBuilder::getQuery#213

Closed
armetiz wants to merge 1 commit intodoctrine:masterfrom
armetiz:patch-5
Closed

QueryBuilder::getQuery#213
armetiz wants to merge 1 commit intodoctrine:masterfrom
armetiz:patch-5

Conversation

@armetiz
Copy link
Contributor

@armetiz armetiz commented Dec 9, 2011

Hi there,
I'm wondering myself if the QueryBuilder::getQuery is a good method name.
Actually, a getMethodObject makes me think that I can use many times the getMethodObject and work with the same object.
e.g :

$qb->getQuery()->useResultCache (true);
$qb->getQuery()->execute();

In my code, the problem is that getQuery return a new instance of Query each time that I call getQuery.
Furthermore, the getQuery method invoke a createQuery method.

So, maybe the QueryBuiler::getQuery can store a reference to the created Query instance, and if the QueryBuilder::getQuery is call many times without any change return the stored instance.
If the QueryBuilder::getQuery have to generate a new Query, throw an exception or something like that.

Because of a change to QueryBuilder::createQuery is a major change, I don't think that It could be the solution, but it's a reflexion around this.

What do you think about that ?

@stof
Copy link
Member

stof commented Dec 9, 2011

I don't think your arguments are enough to break the BC. Doctrine is stable so BC break should be forbidden

@guilhermeblanco
Copy link
Member

Such a change won't be applied at all. It's a BC break for 2.X and we do not want it.
Closing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants