RepositoryQuery: Ensure that we'll adjust a copy of a filter
This commit is contained in:
parent
899a00e983
commit
237b50f953
|
@ -185,6 +185,7 @@ class RepositoryQuery implements QueryInterface, Iterator
|
|||
*/
|
||||
public function setFilter(Filter $filter)
|
||||
{
|
||||
$filter = clone $filter;
|
||||
$this->repository->requireFilter($this->target, $filter);
|
||||
$this->query->setFilter($filter);
|
||||
return $this;
|
||||
|
@ -201,6 +202,7 @@ class RepositoryQuery implements QueryInterface, Iterator
|
|||
*/
|
||||
public function addFilter(Filter $filter)
|
||||
{
|
||||
$filter = clone $filter;
|
||||
$this->repository->requireFilter($this->target, $filter);
|
||||
$this->query->addFilter($filter);
|
||||
return $this;
|
||||
|
|
Loading…
Reference in New Issue