Changeset 5088

Show
Ignore:
Timestamp:
10/15/08 20:09:04 (9 months ago)
Author:
jwage
Message:

[1.0, 1.1] fixes #1556 - issue with query registry not storing copies of queries

Location:
branches
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Query/Registry.php

    r4845 r5088  
    3737    public function add($key, $query) 
    3838    { 
     39        if ($query instanceof Doctrine_Query) { 
     40            $query = clone $query; 
     41        } 
     42 
    3943        if (strpos($key, '/') === false) { 
    4044            $this->_queries[$key] = $query; 
     
    6670        } 
    6771         
    68         return $query; 
     72        return clone $query; 
    6973    } 
    7074     
  • branches/1.1/lib/Doctrine/Query/Registry.php

    r4845 r5088  
    3737    public function add($key, $query) 
    3838    { 
     39        if ($query instanceof Doctrine_Query) { 
     40            $query = clone $query; 
     41        } 
     42 
    3943        if (strpos($key, '/') === false) { 
    4044            $this->_queries[$key] = $query; 
     
    6670        } 
    6771         
    68         return $query; 
     72        return clone $query; 
    6973    } 
    7074