X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fuser.php;h=10e131c7d41202db5a5355f09103f503e0e78b2e;hb=fda78a6777a5f385537fc9f291afb310e12525e5;hp=a7467b2614b745ecf2444173453f889f5ef831fd;hpb=8b8d8e64be3a5fe9fe38a5b23c12cd1aa8529bdd;p=platal.git diff --git a/classes/user.php b/classes/user.php index a7467b2..10e131c 100644 --- a/classes/user.php +++ b/classes/user.php @@ -1,6 +1,6 @@ _profile_fetched || $forceFetch) { $this->_profile_fetched = true; $this->_profile = Profile::get($this, $fields, $visibility); - } else if ($this->_profile !== null && !$this->_profile->visibility->equals($visibility)) { + } else if ($this->_profile !== null && $visibility !== null && !$this->_profile->visibility->equals($visibility)) { return Profile::get($this, $fields, $visibility); } 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() @@ -1101,5 +1107,5 @@ class UserIterator implements PlIterator } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>