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)
|
public function setFilter(Filter $filter)
|
||||||
{
|
{
|
||||||
|
$filter = clone $filter;
|
||||||
$this->repository->requireFilter($this->target, $filter);
|
$this->repository->requireFilter($this->target, $filter);
|
||||||
$this->query->setFilter($filter);
|
$this->query->setFilter($filter);
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -201,6 +202,7 @@ class RepositoryQuery implements QueryInterface, Iterator
|
||||||
*/
|
*/
|
||||||
public function addFilter(Filter $filter)
|
public function addFilter(Filter $filter)
|
||||||
{
|
{
|
||||||
|
$filter = clone $filter;
|
||||||
$this->repository->requireFilter($this->target, $filter);
|
$this->repository->requireFilter($this->target, $filter);
|
||||||
$this->query->addFilter($filter);
|
$this->query->addFilter($filter);
|
||||||
return $this;
|
return $this;
|
||||||
|
|
Loading…
Reference in New Issue