CurrentUserTrait

Trait for classes which require a user to work with.

since

4.2.0

package

Joomla CMS

Methods

getCurrentUser

Returns the current user, if none is set the identity of the global app is returned. This will change in 6.0 and an empty user will be returned.

getCurrentUser() : \Joomla\CMS\User\User
since

4.2.0

Response

User

setCurrentUser

Sets the current user.

setCurrentUser(\Joomla\CMS\User\User currentUser) : 
since

4.2.0

Arguments

currentUser

UserThe current user object

Response

void

Properties

currentUser

The current user object.

since

4.2.0

Type(s)

User