diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-11-28 17:35:05 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-11-28 17:35:05 +0100 |
commit | f0e6876f2ec8ec4576ca0ce8bbfee5bd8082dc1f (patch) | |
tree | d96dc63141f984b18930ee580f534a7cb5989bdc /lib/private | |
parent | 2c157da1c2fece318cab652b56d36c46d50f5e3a (diff) | |
parent | bf2c9be06640c1ce1fff6da893ddb55297069af9 (diff) | |
download | nextcloud-server-f0e6876f2ec8ec4576ca0ce8bbfee5bd8082dc1f.tar.gz nextcloud-server-f0e6876f2ec8ec4576ca0ce8bbfee5bd8082dc1f.zip |
Merge pull request #12488 from owncloud/activity_group_multiple_conditions
activitymanager: concatenate queries with 'or'
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/activitymanager.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/activitymanager.php b/lib/private/activitymanager.php index f31b121c8e8..e0ee7c1b055 100644 --- a/lib/private/activitymanager.php +++ b/lib/private/activitymanager.php @@ -247,16 +247,28 @@ class ActivityManager implements IManager { * @return array */ function getQueryForFilter($filter) { + + $conditions = array(); + $parameters = array(); + foreach($this->extensions as $extension) { $c = $extension(); if ($c instanceof IExtension) { $result = $c->getQueryForFilter($filter); if (is_array($result)) { - return $result; + list($condition, $parameter) = $result; + if ($condition && is_array($parameter)) { + $conditions[] = $condition; + $parameters = array_merge($parameters, $parameter); + } } } } - return array(null, null); + if (empty($conditions)) { + return array(null, null); + } + + return array(' and ((' . implode(') or (', $conditions) . '))', $parameters); } } |