User

User information

Arguments

$user
Id or username.
Default: Current user

Example

Show user full name:

$name = $this->get('user')->getName();

Get user information

Show username:

$name = $this->get('user')->getName();

Get user Profile :

$Profile = $this->get('user')->getProfile();

Get the Page defined in profile Variable:

$Employee = $this->get('user')->getProfilePage('employee');

Do something for only certain users:

if ( $this->get('user')->isId(1001,1002,1003) ){
    // This will be executed only for those three users!!
}

Full method list

Method return Description
getId() int Technical identification number.
getUsername() string Username.
getName() string Full name.
getFirstname() string Lastname.
getLastname() string Firstname.
getPhone() string Phone number.
getEmail() string Email address.
isProfile() bool Return TRUE if user is attached to a profile.
isProfile([$id,$name]) bool Return TRUE if user is attached to one of given profiles.
getProfileId() string Id of the profile user is attached to.
getProfile() eProfile Profile the user is attached to.
getProfileVariable([name]) int Get id of the page profile variable is linked to. Return the first variable, if name not given.
getProfilePage([name]) int Get page the profile variable is linked to. Return the first, if name not given.
getValidUntil() eDate User is valid from.
getValidFrom() eDate User is valid untill.
isValid([date]) bool User is valid on given date.
getModifiedAt() eDate Edit time.
getCreatedAt() eDate Create time.

isId(val[,val,..]) | bool | Return TRUE, if user ID is one of given values.