From 1921c2f74a2d21e46a79988a262f87716b3e1e65 Mon Sep 17 00:00:00 2001 From: Miro Demovic Date: Wed, 26 Feb 2014 08:55:09 +0100 Subject: [PATCH] Allow if parameter exists in SQLFilter --- lib/Doctrine/ORM/Query/Filter/SQLFilter.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php index fc749f151..2fe921b75 100644 --- a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php +++ b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php @@ -107,6 +107,22 @@ abstract class SQLFilter return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); } + /** + * Checks if a parameter was set for the filter. + * + * @param string $name Name of the parameter. + * + * @return boolean + */ + final public function hasParameter($name) + { + if (!isset($this->parameters[$name])) { + return false; + } + + return true; + } + /** * Returns as string representation of the SQLFilter parameters (the state). *