Class Symfony\Component\Console\Event\ConsoleCommandEvent

InheritanceSymfony\Component\Console\Event\ConsoleCommandEvent » Symfony\Component\Console\Event\ConsoleEvent » Symfony\Component\EventDispatcher\Event

Allows to do things before the command is executed, like skipping the command or changing the input.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$command Symfony\Component\Console\Event\ConsoleEvent

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Symfony\Component\Console\Event\ConsoleEvent
commandShouldRun() Returns true if the command is runnable, false otherwise. Symfony\Component\Console\Event\ConsoleCommandEvent
disableCommand() Disables the command, so it won't be run. Symfony\Component\Console\Event\ConsoleCommandEvent
enableCommand() Enables the command. Symfony\Component\Console\Event\ConsoleCommandEvent
getCommand() Gets the command that is executed. Symfony\Component\Console\Event\ConsoleEvent
getDispatcher() Returns the EventDispatcher that dispatches this Event. Symfony\Component\EventDispatcher\Event
getInput() Gets the input instance. Symfony\Component\Console\Event\ConsoleEvent
getName() Gets the event's name. Symfony\Component\EventDispatcher\Event
getOutput() Gets the output instance. Symfony\Component\Console\Event\ConsoleEvent
isPropagationStopped() Returns whether further event listeners should be triggered. Symfony\Component\EventDispatcher\Event
setDispatcher() Stores the EventDispatcher that dispatches this Event. Symfony\Component\EventDispatcher\Event
setName() Sets the event's name property. Symfony\Component\EventDispatcher\Event
stopPropagation() Stops the propagation of the event to further event listeners. Symfony\Component\EventDispatcher\Event

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
RETURN_CODE_DISABLED 113 The return code for skipped commands, this will also be passed into the terminate event. Symfony\Component\Console\Event\ConsoleCommandEvent

Method Details

commandShouldRun() public method

Returns true if the command is runnable, false otherwise.

public bool commandShouldRun ( )
disableCommand() public method

Disables the command, so it won't be run.

public bool disableCommand ( )
enableCommand() public method

Enables the command.

public bool enableCommand ( )