UserCandy Documentation - CurrentUserData Helper
CurrentUserData Helper is used to get User information based on user ID or user Name. This is commonly used with User Profiles. To use this class make sure to add the following to the top of the file:
Code
use Helpers\CurrentUserData;
The following are the different functions within this class: getCUD This function puts a users data into an array based on the userID.
Code
$user_data = CurrentUserData::getCUD($userID);
getCUGroups This function gets current users groups and returns in an array based on the userID.
Code
$user_groups = CurrentUserData::getUserGroups($userID);
getUserName This function gets user's UserName based on userID.
Code
$user_name = CurrentUserData::getUserName($userID);
getUserFirstName This function gets user's First Name based on userID.
Code
$user_firstname = CurrentUserData::getUserFirstName($userID);
getUserEmail This function gets user's EMail based on userID.
Code
$user_email = CurrentUserData::getUserEmail($userID);
getUserImage This function gets user's Main Profile Image based on userID.
Code
$user_image = CurrentUserData::getUserImage($userID);
Feel free to read through the rest of the functions available in the file. We have listed the most common above.