From d1908f7207565a3cdd47ee42dd73a38642cde519 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 22 Jul 2011 14:20:36 +0200 Subject: [PATCH] [DDC-551] Keep filter parameters and enabled filters sorted for hashing --- lib/Doctrine/ORM/EntityManager.php | 3 +++ lib/Doctrine/ORM/Query/Filter/SQLFilter.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 2605e0cec..558477ca4 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -763,6 +763,9 @@ class EntityManager implements ObjectManager if(!isset($this->enabledFilters[$name])) { $this->enabledFilters[$name] = new $filterClass($this->conn); + + // Keep the enabled filters sorted for the hash + ksort($this->enabledFilters); } return $this->enabledFilters[$name]; diff --git a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php index 9477636e3..16887fd4d 100644 --- a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php +++ b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php @@ -47,6 +47,9 @@ abstract class SQLFilter // @todo: check for a valid type? $this->parameters[$name] = array('value' => $value, 'type' => $type); + // Keep the parameters sorted for the hash + ksort($this->parameters); + return $this; }