Utility Profile::current() to get current user's profile
This commit is contained in:
parent
70faf76001
commit
f9a91a2809
@ -1304,4 +1304,15 @@ class Profile extends Memcached_DataObject
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function current()
|
||||||
|
{
|
||||||
|
$user = common_current_user();
|
||||||
|
if (empty($user)) {
|
||||||
|
$profile = null;
|
||||||
|
} else {
|
||||||
|
$profile = $user->getProfile();
|
||||||
|
}
|
||||||
|
return $profile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user