API16

API16:JUserHelper/getProfile

From Joomla! Documentation

Revision as of 02:16, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Gets the user profile information



Syntax

getProfile($userId=0)
Parameter Name Default Value Description
$userId 0

Defined in

libraries/joomla/user/helper.php

Importing

jimport( 'joomla.user.helper' );

Source Body

function getProfile($userId = 0)
{
        if ($userId == 0) {
                $user   = & JFactory::getUser();
                $userId = $user->id;
        }
        else {
                $user   = & JFactory::getUser((int) $userId);
        }

        // Get the dispatcher and load the users plugins.
        $dispatcher     = &JDispatcher::getInstance();
        JPluginHelper::importPlugin('users');

        $data = new JObject;

        // Trigger the data preparation event.
        $results = $dispatcher->trigger('onPrepareUserProfileData', array($userId, &$data));

        return $data;
}



Examples

Code Examples