BeforeCommandExecuteEvent
Extends ConsoleEventEvent triggered before a command is executed.
| since |
2.0.0 |
|---|---|
| package |
Joomla Framework |
Methods
__construct
Constructor.
__construct(string name, array arguments = array()) : mixed
| since |
1.0 |
|---|
Arguments
- name
stringThe event name.- arguments
arrayThe event arguments.
Response
mixed
addArgument
Add an event argument, only if it is not existing.
addArgument(string name, mixed value) : \Joomla\Event\Event
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.- value
mixedThe argument value.
Response
\Joomla\Event\EventThis method is chainable.
clearArguments
Clear all event arguments.
clearArguments() : array
| since |
1.0 |
|---|
Response
arrayThe old arguments.
count
Count the number of arguments.
count() : int
| since |
1.0 |
|---|
Response
intThe number of arguments.
disableCommand
Disable the command.
disableCommand() : void
| since |
2.0.0 |
|---|
enableCommand
Enable the command.
enableCommand() : void
| since |
2.0.0 |
|---|
getApplication
Get the active application.
getApplication() : \Joomla\Console\Application
| since |
2.0.0 |
|---|
Response
\Joomla\Console\Application
getArgument
Get an event argument value.
getArgument(string name, mixed default = null) : mixed
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.- default
mixedThe default value if not found.
Response
mixedThe argument value or the default value.
getArguments
Get all event arguments.
getArguments() : array
| since |
1.0 |
|---|
Response
arrayAn associative array of argument names as keys
and their values as values.
getCommand
Get the command being executed.
getCommand() : \Joomla\Console\Command\AbstractCommand|null
| since |
2.0.0 |
|---|
Response
\Joomla\Console\Command\AbstractCommand|null
getName
Get the event name.
getName() : string
| since |
1.0 |
|---|
Response
stringThe event name.
hasArgument
Tell if the given event argument exists.
hasArgument(string name) : bool
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
boolTrue if it exists, false otherwise.
isCommandEnabled
Check if the command is enabled.
isCommandEnabled() : bool
| since |
2.0.0 |
|---|
Response
bool
isStopped
Tell if the event propagation is stopped.
isStopped() : bool
| since |
1.0 |
|---|
Response
boolTrue if stopped, false otherwise.
offsetExists
Tell if the given event argument exists.
offsetExists(string name) : bool
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
boolTrue if it exists, false otherwise.
offsetGet
Get an event argument value.
offsetGet(string name) : mixed
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
mixedThe argument value or null if not existing.
offsetSet
Set the value of an event argument.
offsetSet(string name, mixed value) : void
| throws |
|
|---|---|
| since |
1.0 |
Arguments
- name
stringThe argument name.- value
mixedThe argument value.
offsetUnset
Remove an event argument.
offsetUnset(string name) : void
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
removeArgument
Remove an event argument.
removeArgument(string name) : mixed
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
mixedThe old argument value or null if it is not existing.
serialize
Serialize the event.
serialize() : string
| since |
1.0 |
|---|
Response
stringThe serialized event.
setArgument
Set the value of an event argument.
setArgument(string name, mixed value) : \Joomla\Event\Event
If the argument already exists, it will be overridden.
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.- value
mixedThe argument value.
Response
\Joomla\Event\EventThis method is chainable.
stop
Stop the event propagation.
stop() : void
| since |
1.0 |
|---|
unserialize
Unserialize the event.
unserialize(string serialized) : void
| since |
1.0 |
|---|
Arguments
- serialized
stringThe serialized event.
Constants
RETURN_CODE_DISABLED
The return code for a command disabled by this event.
| Value | 113 |
|---|---|
| since |
2.0.0 |
Type(s)
int
Properties
commandEnabled
Flag indicating the command is enabled
| since |
2.0.0 |
|---|
Type(s)
bool
application
The active application.
| since |
2.0.0 |
|---|
Type(s)
\Joomla\Console\Application
command
The command being executed.
| since |
2.0.0 |
|---|
Type(s)
\Joomla\Console\Command\AbstractCommand|null
name
The event name.
| since |
1.0 |
|---|
Type(s)
string
arguments
The event arguments.
| since |
1.0 |
|---|
Type(s)
array
stopped
A flag to see if the event propagation is stopped.
| since |
1.0 |
|---|
Type(s)
bool