Add hook for pre-fetching the profile.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 4 Nov 2012 22:49:58 +0000 (23:49 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sat, 10 Nov 2012 16:04:43 +0000 (17:04 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/user.php

index b8cca26..4626b85 100644 (file)
@@ -369,6 +369,12 @@ class User extends PlUser
         return $this->_profile;
     }
 
+    public function setPrefetchedProfile(Profile $profile)
+    {
+        $this->_profile_fetched = true;
+        $this->_profile = $profile;
+    }
+
     /** Return true if the user has an associated profile.
      */
     public function hasProfile()