diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-03-23 19:11:38 +0100 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-03-23 19:11:38 +0100 |
commit | cb28cd3371e215646765f6d1d06263a54a5526f1 (patch) | |
tree | 614d20b4307df44e43fb8dde6c5e5db2be78d13f /src | |
parent | 66c60880d26df7161e8bbe46d52b058e04f7ea05 (diff) | |
download | semanticscuttle-cb28cd3371e215646765f6d1d06263a54a5526f1.tar.gz semanticscuttle-cb28cd3371e215646765f6d1d06263a54a5526f1.tar.bz2 |
unittest for getAdminTags as well as CS and docblock fixes on it
Diffstat (limited to 'src')
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark2Tag.php | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php index e3997dd..d367b62 100644 --- a/src/SemanticScuttle/Service/Bookmark2Tag.php +++ b/src/SemanticScuttle/Service/Bookmark2Tag.php @@ -454,15 +454,37 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService return $output; } - function &getAdminTags($limit = 30, $logged_on_user = NULL, $days = NULL) { + + + /** + * Returns the tags used by admin users + * + * @param integer $limit Number of tags to return + * @param integer $logged_on_user ID of the user that's currently logged in. + * If the logged in user equals the $user to find + * tags for, tags of private bookmarks are + * returned. + * @param integer $days Bookmarks have to be changed in the last X days + * if their tags shall count* + * + * @return array Array of found tags. Each tag entry is an array with two keys, + * 'tag' (tag name) and 'bCount'. + * + * @see getPopularTags() + */ + public function getAdminTags( + $limit = 30, $logged_on_user = null, $days = null + ) { // look for admin ids - $userservice = SemanticScuttle_Service_Factory :: get('User'); - $adminIds = $userservice->getAdminIds(); + $userservice = SemanticScuttle_Service_Factory::get('User'); + $adminIds = $userservice->getAdminIds(); // ask for their tags return $this->getPopularTags($adminIds, $limit, $logged_on_user, $days); } + + function &getContactTags($user, $limit = 30, $logged_on_user = NULL, $days = NULL) { // look for contact ids $userservice = SemanticScuttle_Service_Factory :: get('User'); @@ -477,6 +499,8 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService return $this->getPopularTags($contacts, $limit, $logged_on_user, $days); } + + /** * The the most popular tags and their usage count * |