JomSocial User Object

Revision as of 15:56, 17 January 2013 by Sinisakrisan (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Each user within JomSocial is represented by a special object called CUser. CUser inherit all JUser object properties and added a couple new functionality.

Retrieve User Object

// Return user with the given id
$user =& CFactory::getUser($userId);
 
// Return current logged-in user. If no one is logged-in, it will
// return a visitor object
$user =& CFactory::getUser();


Retrieve any user-specific information from custom field

$user =& CFactory::getUser($userId);
$data = $user->getInfo('FIELD_CODE');