AbstractApplication

Implements ConfigurationAwareApplicationInterface, LoggerAwareInterface, DispatcherAwareInterface

Joomla Framework Base Application Class

abstract
since

1.0.0

package

Joomla Framework

Methods

__construct

Class constructor.

__construct(\Joomla\Registry\Registry|null config = null) : mixed
since

1.0.0

Arguments

config

\Joomla\Registry\Registry|nullAn 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.

Response

mixed

close

Method to close the application.

close(int code) : void
since

1.0.0

Arguments

code

intThe exit code (optional; default is 0).

dispatchEvent

Dispatches an application event if the dispatcher has been set.

dispatchEvent(string eventName, \Joomla\Event\EventInterface|null event = null) : \Joomla\Event\EventInterface|null
since

2.0.0

Arguments

eventName

stringThe event to dispatch.

event

\Joomla\Event\EventInterface|nullThe event object.

Response

\Joomla\Event\EventInterface|nullThe dispatched event or null if no dispatcher is set

doExecute

Method to run the application routines.

doExecute() : mixed
abstract

Most likely you will want to instantiate a controller and execute it, or perform some sort of task directly.

since

1.0.0

Response

mixed

execute

Execute the application.

execute() : void
since

1.0.0

get

Returns a property of the object or the default value if the property is not set.

get(string key, mixed default = null) : mixed
since

1.0.0

Arguments

key

stringThe name of the property.

default

mixedThe default value (optional) if none is set.

Response

mixedThe value of the configuration.

getDispatcher

Get the event dispatcher.

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

1.2.0

throws

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

Response

\Joomla\Event\DispatcherInterface

getLogger

Get the logger.

getLogger() : \Psr\Log\LoggerInterface
since

1.0.0

Response

\Psr\Log\LoggerInterface

initialise

Custom initialisation method.

initialise() : void

Called at the end of the AbstractApplication::__construct method. This is for developers to inject initialisation code for their application classes.

since

1.0.0

set

Modifies a property of the object, creating it if it does not already exist.

set(string key, mixed value = null) : mixed
since

1.0.0

Arguments

key

stringThe name of the property.

value

mixedThe value of the property to set (optional).

Response

mixedPrevious value of the property

setConfiguration

Sets the configuration for the application.

setConfiguration(\Joomla\Registry\Registry config) : $this
since

1.0.0

Arguments

config

\Joomla\Registry\RegistryA registry object holding the configuration.

Response

$this

setDispatcher

Set the dispatcher to use.

setDispatcher(\Joomla\Event\DispatcherInterface dispatcher) : $this
inherited
since

1.2.0

Arguments

dispatcher

\Joomla\Event\DispatcherInterfaceThe dispatcher to use.

Response

$this

Properties

config

The application configuration object.

since

1.0.0

Type(s)

\Joomla\Registry\Registry

dispatcher

Event Dispatcher

inherited
since

1.2.0

Type(s)

\Joomla\Event\DispatcherInterface|null