From dfb82ad442e2efc626310a8e3854fa7657ea49d3 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 6 May 2009 16:25:54 -0400 Subject: [PATCH] Add a userId filter to Content_Tagger::getObjects() --- content/lib/Tagger.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'])) { -- 2.11.0