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 5.0 and an empty user will be returned.

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

4.2.0

Response

\Joomla\CMS\User\User

setCurrentUser

Sets the current user.

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

4.2.0

Arguments

currentUser

\Joomla\CMS\User\UserThe current user object

Properties

currentUser

The current user object.

since

4.2.0

Type(s)

User