Simplify functions regarding locally cached profiles etc.
This commit is contained in:
@@ -123,19 +123,15 @@ class User extends Managed_DataObject
|
||||
public function getProfile()
|
||||
{
|
||||
if (!isset($this->_profile[$this->id])) {
|
||||
$this->_setProfile(Profile::getKV('id', $this->id));
|
||||
$profile = Profile::getKV('id', $this->id);
|
||||
if (!$profile instanceof Profile) {
|
||||
throw new UserNoProfileException($this);
|
||||
}
|
||||
$this->_profile[$this->id] = $profile;
|
||||
}
|
||||
return $this->_profile[$this->id];
|
||||
}
|
||||
|
||||
public function _setProfile(Profile $profile=null)
|
||||
{
|
||||
if (!$profile instanceof Profile) {
|
||||
throw new UserNoProfileException($this);
|
||||
}
|
||||
$this->_profile[$this->id] = $profile;
|
||||
}
|
||||
|
||||
public function getUri()
|
||||
{
|
||||
return $this->uri;
|
||||
|
Reference in New Issue
Block a user