aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2010-10-08 17:43:05 +0200
committerChristian Weiske <cweiske@cweiske.de>2010-10-08 17:43:05 +0200
commitbe126cc958212ed74fe916eabcb1e6ac928df5e4 (patch)
tree80a9644be8b1af487b8b9383cd36b13273f975e2 /src/SemanticScuttle/Service
parentcd023dea530870a047ca87405fedc3ddbc06d787 (diff)
downloadsemanticscuttle-be126cc958212ed74fe916eabcb1e6ac928df5e4.tar.gz
semanticscuttle-be126cc958212ed74fe916eabcb1e6ac928df5e4.tar.bz2
tests for getadminlinkedtags
Diffstat (limited to 'src/SemanticScuttle/Service')
-rw-r--r--src/SemanticScuttle/Service/User.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/SemanticScuttle/Service/User.php b/src/SemanticScuttle/Service/User.php
index d74d104..fd9d84f 100644
--- a/src/SemanticScuttle/Service/User.php
+++ b/src/SemanticScuttle/Service/User.php
@@ -203,18 +203,26 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
}
}
- /* Takes an numerical "id" or a string "username"
- and returns the numerical "id" if the user exists else returns NULL */
- function getIdFromUser($user) {
+ /**
+ * Obtains the ID of the given user name.
+ * If a user ID is passed, it is returned.
+ * In case the user does not exist, NULL is returned.
+ *
+ * @param string|integer $user User name or user ID
+ *
+ * @return integer NULL if not found or the user ID
+ */
+ public function getIdFromUser($user)
+ {
if (is_int($user)) {
return intval($user);
} else {
$objectUser = $this->getObjectUserByUsername($user);
- if($objectUser != NULL) {
+ if ($objectUser != null) {
return $objectUser->getId();
}
}
- return NULL;
+ return null;
}
/**