Since the builder is designed as a mutable structure, using it as an
injectable dependency is very very risky. I suggest at least cloning it,
before attempting to store it or modifying it.

On 2 Nov 2018 03:07, "Nate Braner" <[email protected]> wrote:

Well I'm not above saying we are using it wrong. In our case it is injected
into the class constructor.  Are you suggesting that each method within a
class/model has a instance?

On Thu, Nov 1, 2018, 8:11 PM Marco Pivetta <[email protected] wrote:

> I didn't even know you could "reset" a query builder: why not simply
> making a new instance? Note that builder objects aren't usually
> services/injectables.
>
> On 1 Nov 2018 18:27, "Nate Braner" <[email protected]> wrote:
>
> Hey everyone,
>
> So we are using doctrine/dbal outside of Symfony as we gear up to move the
> project into a symfony framework,
>
> In running queries I use resetqueryparts() to reset the query but that
> does not reset the setMaxResults property.  So then all of hte following
> queries that are run in that object have the same limit set.
>
> What is the best way to "reset" that object back to null?  It only allows
> integers as arguments.
>
> Thanks
>
> --
> 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 https://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 https://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
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 https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to