Add helper methods User::getWithUID and User::getSilentWithUID.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 30 Dec 2008 17:12:07 +0000 (18:12 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 30 Dec 2008 17:12:07 +0000 (18:12 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/pluser.php

index 1aa5814..0377bdc 100644 (file)
@@ -271,6 +271,11 @@ abstract class PlUser
         }
     }
 
+    public static function getWithUID($uid, $callback = false)
+    {
+        return User::getWithValues(null, array('user_id' => $uid), $callback);
+    }
+
     // Same as above, but using the silent callback as default.
     public static function getSilent($login)
     {
@@ -282,6 +287,11 @@ abstract class PlUser
         return User::getWithValues($login, $values, array('User', '_silent_user_callback'));
     }
 
+    public static function getSilentWithUID($uid)
+    {
+        return User::getWithValues($uid, array('User', '_silent_user_callback'));
+    }
+
     /**
      * Retrieves User objects corresponding to the @p logins, and eventually
      * extracts and returns the @p property. If @p strict mode is disabled, it