From f9a91a28097a4d5e73bbf23c24aa0c908be98c4e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 11 Apr 2011 11:16:30 -0400 Subject: [PATCH] Utility Profile::current() to get current user's profile --- classes/Profile.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/Profile.php b/classes/Profile.php index ac008877c4..a47744a124 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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; + } } -- 2.39.5