aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-03-24 08:36:54 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-03-24 08:36:54 +0100
commit637e276ac7dc0e9acdbb79ed68415c1770ce7a3f (patch)
tree4778da56a0e98a2c5c176670a38ca88e50d41c9f /src/SemanticScuttle
parentcb28cd3371e215646765f6d1d06263a54a5526f1 (diff)
downloadsemanticscuttle-637e276ac7dc0e9acdbb79ed68415c1770ce7a3f.tar.gz
semanticscuttle-637e276ac7dc0e9acdbb79ed68415c1770ce7a3f.tar.bz2
unittest for Bookmark2Tag::getContactTags, CS and docblock
Diffstat (limited to 'src/SemanticScuttle')
-rw-r--r--src/SemanticScuttle/Service/Bookmark2Tag.php31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php
index d367b62..478b47e 100644
--- a/src/SemanticScuttle/Service/Bookmark2Tag.php
+++ b/src/SemanticScuttle/Service/Bookmark2Tag.php
@@ -485,13 +485,33 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
- function &getContactTags($user, $limit = 30, $logged_on_user = NULL, $days = NULL) {
+
+ /**
+ * Returns the tags used by users that are part of the user's watchlist,
+ * and the current user's own tags.
+ *
+ * @param integer $user ID of the user to get the watchlist from
+ * @param integer $limit Number of tags to return
+ * @param integer $logged_on_user ID of the user that's currently logged in.
+ * If set, that user is added to the list of
+ * people to get the tags from
+ * @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 getContactTags(
+ $user, $limit = 30, $logged_on_user = null, $days = null
+ ) {
// look for contact ids
- $userservice = SemanticScuttle_Service_Factory :: get('User');
+ $userservice = SemanticScuttle_Service_Factory::get('User');
$contacts = $userservice->getWatchlist($user);
- // add the user (to show him/her also his/her tags)
- if(!is_null($logged_on_user)) {
+ // add the user (to show him also his own tags)
+ if (!is_null($logged_on_user)) {
$contacts[] = $logged_on_user;
}
@@ -516,6 +536,9 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
*
* @return array Array of found tags. Each tag entry is an array with two keys,
* 'tag' (tag name) and 'bCount'.
+ *
+ * @see getAdminTags()
+ * @see getContactTags()
*/
public function getPopularTags(
$user = null, $limit = 30, $logged_on_user = null, $days = null