Request
class Request (View source)
Represents a CLI request.
Properties
protected string | $controllerObjectName | ||
protected string | $controllerCommandName | ||
protected Command|null | $command | ||
protected array | $arguments | The arguments for this request |
|
protected array | $exceedingArguments | ||
protected bool | $dispatched | If this request has been changed and needs to be dispatched again |
Methods
Sets the dispatched flag
If this request has been dispatched and addressed by the responsible controller and the response is ready to be sent.
Sets the object name of the controller
Returns the object name of the controller
Sets the name of the command contained in this request.
Returns the name of the command the controller is supposed to execute.
Returns the command object for this request
Sets the value of the specified argument
Sets the whole arguments array and therefore replaces any arguments which existed before.
Returns the value of the specified argument
Checks if an argument of the given name exists (is set)
Returns an ArrayObject of arguments and their values
Sets the exceeding arguments
Returns additional unnamed arguments (if any) which have been passed through the command line after all required arguments (if any) have been specified.
Details
void
setDispatched(bool $flag)
Sets the dispatched flag
bool
isDispatched()
If this request has been dispatched and addressed by the responsible controller and the response is ready to be sent.
The dispatcher will try to dispatch the request again if it has not been addressed yet.
void
setControllerObjectName(string $controllerObjectName)
Sets the object name of the controller
string
getControllerObjectName()
Returns the object name of the controller
void
setControllerCommandName(string $commandName)
Sets the name of the command contained in this request.
Note that the command name must start with a lower case letter and is case sensitive.
string
getControllerCommandName()
Returns the name of the command the controller is supposed to execute.
Command
getCommand()
Returns the command object for this request
void
setArgument(string $argumentName, mixed $value)
Sets the value of the specified argument
void
setArguments(array $arguments)
Sets the whole arguments array and therefore replaces any arguments which existed before.
mixed
getArgument(string $argumentName)
Returns the value of the specified argument
bool
hasArgument(string $argumentName)
Checks if an argument of the given name exists (is set)
array
getArguments()
Returns an ArrayObject of arguments and their values
void
setExceedingArguments(array $exceedingArguments)
Sets the exceeding arguments
array
getExceedingArguments()
Returns additional unnamed arguments (if any) which have been passed through the command line after all required arguments (if any) have been specified.
For a command method with the signature ($argument1, $argument2) and for the command line ./flow acme:foo --argument1 Foo --argument2 Bar baz quux this method would return array(0 => 'baz', 1 => 'quux')