Utility Profile::current() to get current user's profile

This commit is contained in:
Evan Prodromou 2011-04-11 11:16:30 -04:00
parent 70faf76001
commit f9a91a2809

View File

@ -1304,4 +1304,15 @@ class Profile extends Memcached_DataObject
return true;
}
static function current()
{
$user = common_current_user();
if (empty($user)) {
$profile = null;
} else {
$profile = $user->getProfile();
}
return $profile;
}
}