diff options
Diffstat (limited to 'classes/Profile.php')
-rw-r--r-- | classes/Profile.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index d7617f0b7..8f8679550 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -960,4 +960,25 @@ class Profile extends Memcached_DataObject return $feed; } + + static function fromURI($uri) + { + $profile = null; + + if (Event::handle('StartGetProfileFromURI', array($uri, &$profile))) { + // Get a local user or remote (OMB 0.1) profile + $user = User::staticGet('uri', $uri); + if (!empty($user)) { + $profile = $user->getProfile(); + } else { + $remote_profile = Remote_profile::staticGet('uri', $uri); + if (!empty($remote_profile)) { + $profile = Profile::staticGet('id', $remote_profile->profile_id); + } + } + Event::handle('EndGetProfileFromURI', array($uri, $profile)); + } + + return $profile; + } } |