BaseApplication

Extends \Joomla\Application\AbstractApplication Implements \Joomla\Event\DispatcherAwareInterface

Joomla Platform Base Application Class

abstract deprecated
property-read

The application input object

since

3.0.0

deprecated

5.0 Application classes should be based on \Joomla\Application\AbstractApplication

Methods

__construct

Class constructor.

__construct(\Joomla\CMS\Input\Input $input = null, \Joomla\Registry\Registry $config = null) 
since

3.0.0

Arguments

$input

\Joomla\CMS\Input\InputAn optional argument to provide dependency injection for the application's input object. If the argument is a \JInput object that object will become the application's input object, otherwise a default input object is created.

$config

\Joomla\Registry\RegistryAn optional argument to provide dependency injection for the application's config object. If the argument is a Registry object that object will become the application's config object, otherwise a default config object is created.

getDispatcher

Get the event dispatcher.

getDispatcher() : \Joomla\Event\DispatcherInterface
inherited abstract
since

4.0.0

throws

\UnexpectedValueExceptionMay be thrown if the dispatcher has not been set.

Response

\Joomla\Event\DispatcherInterface

getIdentity

Get the application identity.

getIdentity() : \Joomla\CMS\User\User
inherited
since

4.0.0

Response

\Joomla\CMS\User\User

getLogger

Get the logger.

getLogger() : \Psr\Log\LoggerInterface
inherited abstract
since

4.0.0

Response

\Psr\Log\LoggerInterface

loadIdentity

Allows the application to load a custom or default identity.

loadIdentity(\Joomla\CMS\User\User $identity = null) : $this
inherited
since

4.0.0

Arguments

$identity

\Joomla\CMS\User\UserAn optional identity object. If omitted, a null user object is created.

Response

$this

registerEvent

Registers a handler to a particular event group.

registerEvent(string $event, callable $handler) : $this
inherited
since

4.0.0

Arguments

$event

stringThe event name.

$handler

callableThe handler, a function or an instance of an event object.

Response

$this

setUserFactory

Set the user factory to use.

setUserFactory(\Joomla\CMS\User\UserFactoryInterface $userFactory) : void
inherited
since

4.0.0

Arguments

$userFactory

\Joomla\CMS\User\UserFactoryInterfaceThe user factory to use

triggerEvent

Calls all handlers associated with an event group.

triggerEvent(string $eventName, array|\Joomla\Event\Event $args = array()) : array
inherited deprecated

This is a legacy method, implementing old-style (Joomla! 3.x) plugin calls. It's best to go directly through the Dispatcher and handle the returned EventInterface object instead of going through this method. This method is deprecated and will be removed in Joomla! 5.x.

This method will only return the 'result' argument of the event

since

4.0.0

throws

\InvalidArgumentException

deprecated

5.0

Arguments

$eventName

stringThe event name.

$args

array|\Joomla\Event\EventAn array of arguments or an Event object (optional).

Response

arrayAn array of results from each function call. Note this will be an empty array if no dispatcher is set.

Properties

identity

The application identity object.

inherited
since

4.0.0

Type(s)

\Joomla\CMS\User\User

userFactory

UserFactoryInterface

inherited

input

The application input object

Type(s)

\Joomla\CMS\Input\Input