Back to UserHelper class

Method getProfile

public static object
getProfile
(mixed $userId = 0)
Gets the user profile information
Parameters
  • int $userId The id of the user.
Returns
  • object
Since
  • 1.7.0
Class: UserHelper
Project: Joomla

Method getProfile - Source code

/**
 * Gets the user profile information
 *
 * @param   integer  $userId  The id of the user.
 *
 * @return  object
 *
 * @since   1.7.0
 */
public static function getProfile($userId = 0)
{
    if ($userId == 0) {
        $user = Factory::getUser();
        $userId = $user->id;
    }
    // Get the dispatcher and load the user's plugins.
    PluginHelper::importPlugin('user');
    $data = new CMSObject();
    $data->id = $userId;
    // Trigger the data preparation event.
    Factory::getApplication()->triggerEvent('onContentPrepareData', array('com_users.profile', &$data));
    return $data;
}