aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service
diff options
context:
space:
mode:
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;
}
/**