From: Michael J. Rubinsky Date: Wed, 6 May 2009 20:25:54 +0000 (-0400) Subject: Add a userId filter to Content_Tagger::getObjects() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dfb82ad442e2efc626310a8e3854fa7657ea49d3;p=horde.git Add a userId filter to Content_Tagger::getObjects() --- diff --git a/content/lib/Tagger.php b/content/lib/Tagger.php index 5d2887edd..b3e95eb30 100644 --- a/content/lib/Tagger.php +++ b/content/lib/Tagger.php @@ -349,6 +349,7 @@ class Content_Tagger * notTagId Don't return objects tagged with one or more tags. * typeId Only return objects with a specific type. * objectId Return objects with the same tags as $objectId. + * userId Limit results to objects tagged by a specific user. * * @return array An array of object ids. */ @@ -405,7 +406,10 @@ class Content_Tagger $sql .= ' AND objects.type_id IN (' . implode(', ', $args['typeId']) . ')'; } - + if (!empty($args['userId'])) { + $args['userId'] = $this->_userManager->ensureUsers($args['userId']); + $sql .= ' AND tagged.user_id IN ( ' . implode(', ', $args['userId']) . ')'; + } } if (isset($args['limit'])) {