Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1933

Problem with parameters when clone Doctrine\ORM\QueryBuilder

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, Git Master
    • Fix Version/s: Git Master
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Hi, here problem with cloning \Doctrine\ORM\QueryBuilder

      Example
      $queryBuilder = new QueryBuilder($em);
      
      $queryBuilder->setParameter('parameter1', 'value1');
      
      $copy = clone $queryBuilder;
      $copy->setParameter('parameter2', 'value2');
      
      
      count($queryBuilder->getParameters()) // equals 2
      //expects 1
      
      
      

      Solution:

      QueryBuilder
      public function __clone
      {
         ......
      
         $this->parameters = clone $this->parameters;
      }
      

        Activity

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Gandzy Ghennady
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: