<?php
/***************************************************************************
- * Copyright (C) 2003-2011 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
if (!$this->_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()
}
}
-// 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:
?>