]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile.php
Make better use of Subscription class
[quix0rs-gnu-social.git] / classes / Profile.php
index 51b1fb72a87500911a895eebf3f25c102e977f43..f4ac30cb035e379b37f3b77288766b9a11fa3df7 100644 (file)
@@ -82,6 +82,16 @@ class Profile extends Managed_DataObject
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
+    public static function getByEmail($email)
+    {
+        // in the future, profiles should have emails stored...
+        $user = User::getKV('email', $email);
+        if (!($user instanceof User)) {
+            throw new NoSuchUserException(array('email'=>$email));
+        }
+        return $user->getProfile();
+    } 
+
     protected $_user = -1;  // Uninitialized value distinct from null
 
     public function getUser()