diff options
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r-- | engine/lib/users.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index 02a7773dd..205c7c66c 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -251,7 +251,7 @@ public function getCollections($subtype="", $limit = 10, $offset = 0) { get_user_collections($this->getGUID(), $subtype, $limit, $offset); }
}
-
+ /**
* Return the user specific details of a user by a row.
*
@@ -406,6 +406,27 @@ function get_user_objects($user_guid, $subtype = "", $limit = 10, $offset = 0) {
return get_entities('object',$subtype, $user_guid, "time_created desc", $limit, $offset);
}
+ + /** + * Get a user object from a GUID. + * + * This function returns an ElggUser from a given GUID. + * @param int $guid The GUID + * @return ElggUser|false + * @throws InvalidParameterException if $GUID exists but is not an ElggUser. + */ + function get_user($guid) + { + $result = get_entity($guid); + + if (($result) && (!($result instanceof ElggUser))) + throw new InvalidParameterException("GUID:$guid is not an ElggUser"); + + if ($result) + return $result; + + return false; + } /**
* Get user by username
|