From 07490de9d6c1845b3af1eb288bc9e6121be0d744 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 17 Jan 2011 16:58:42 -0500 Subject: [PATCH] Allow sqln driver to take an array of 'attribute' filters as well --- framework/Share/lib/Horde/Share/Sqlng.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/Share/lib/Horde/Share/Sqlng.php b/framework/Share/lib/Horde/Share/Sqlng.php index 9efc14b06..e729fd56e 100644 --- a/framework/Share/lib/Horde/Share/Sqlng.php +++ b/framework/Share/lib/Horde/Share/Sqlng.php @@ -339,7 +339,12 @@ class Horde_Share_Sqlng extends Horde_Share_Sql // Build attribute/key filter. $where = '(' . $where . ') '; foreach ($attributes as $key => $value) { - $where .= ' AND ' . $key . ' = ' . $this->_db->quote($value); + if (is_array($value)) { + $value = array_map(array($this->_db, 'quote'), $value); + $where .= ' AND ' . $key . ' IN (' . implode(', ', $value) . ')'; + } else { + $where .= ' AND ' . $key . ' = ' . $this->_db->quote($value); + } } } elseif (!empty($attributes)) { // Restrict to shares owned by the user specified in the -- 2.11.0