Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 2.2
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/213

      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 :

      ```php
      $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 ?

        Activity

        Hide
        Guilherme Blanco added a comment -

        This includes a BC break.
        Marking as won't fix.

        Show
        Guilherme Blanco added a comment - This includes a BC break. Marking as won't fix.

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: