PHP Class Neos\Flow\Cli\Request

Inheritance: implements Neos\Flow\Mvc\RequestInterface
Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$arguments array The arguments for this request
$command Command
$commandLineArguments array
$controllerCommandName string
$controllerObjectName string
$dispatched boolean If this request has been changed and needs to be dispatched again
$exceedingArguments array

Public Methods

Method Description
getArgument ( string $argumentName ) : string Returns the value of the specified argument
getArguments ( ) : array Returns an ArrayObject of arguments and their values
getCommand ( ) : Command Returns the command object for this request
getControllerCommandName ( ) : string Returns the name of the command the controller is supposed to execute.
getControllerObjectName ( ) : string Returns the object name of the controller
getExceedingArguments ( ) : array Returns additional unnamed arguments (if any) which have been passed through the command line after all required arguments (if any) have been specified.
getMainRequest ( ) : Request Returns the this request, as CLI request nesting is not supported.
hasArgument ( string $argumentName ) : boolean Checks if an argument of the given name exists (is set)
isDispatched ( ) : boolean If this request has been dispatched and addressed by the responsible controller and the response is ready to be sent.
isMainRequest ( ) : boolean Returns true, as CLI request nesting is not supported.
setArgument ( string $argumentName, mixed $value ) : void Sets the value of the specified argument
setArguments ( array $arguments ) : void Sets the whole arguments array and therefore replaces any arguments which existed before.
setControllerCommandName ( string $commandName ) : void Sets the name of the command contained in this request.
setControllerObjectName ( string $controllerObjectName ) : void Sets the object name of the controller
setDispatched ( boolean $flag ) : void Sets the dispatched flag
setExceedingArguments ( array $exceedingArguments ) : void Sets the exceeding arguments

Method Details

getArgument() public method

Returns the value of the specified argument
public getArgument ( string $argumentName ) : string
$argumentName string Name of the argument
return string Value of the argument

getArguments() public method

Returns an ArrayObject of arguments and their values
public getArguments ( ) : array
return array Array of arguments and their values (which may be arguments and values as well)

getCommand() public method

Returns the command object for this request
public getCommand ( ) : Command
return Command

getControllerCommandName() public method

Returns the name of the command the controller is supposed to execute.
public getControllerCommandName ( ) : string
return string Command name

getControllerObjectName() public method

Returns the object name of the controller
public getControllerObjectName ( ) : string
return string The controller's object name

getExceedingArguments() public method

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')
public getExceedingArguments ( ) : array
return array Numeric array of exceeding argument values

getMainRequest() public method

Returns the this request, as CLI request nesting is not supported.
public getMainRequest ( ) : Request
return Request

hasArgument() public method

Checks if an argument of the given name exists (is set)
public hasArgument ( string $argumentName ) : boolean
$argumentName string Name of the argument to check
return boolean TRUE if the argument is set, otherwise FALSE

isDispatched() public method

The dispatcher will try to dispatch the request again if it has not been addressed yet.
public isDispatched ( ) : boolean
return boolean TRUE if this request has been dispatched successfully

isMainRequest() public method

Returns true, as CLI request nesting is not supported.
public isMainRequest ( ) : boolean
return boolean

setArgument() public method

Sets the value of the specified argument
public setArgument ( string $argumentName, mixed $value ) : void
$argumentName string Name of the argument to set
$value mixed The new value
return void

setArguments() public method

Sets the whole arguments array and therefore replaces any arguments which existed before.
public setArguments ( array $arguments ) : void
$arguments array An array of argument names and their values
return void

setControllerCommandName() public method

Note that the command name must start with a lower case letter and is case sensitive.
public setControllerCommandName ( string $commandName ) : void
$commandName string Name of the command to execute by the controller
return void

setControllerObjectName() public method

Sets the object name of the controller
public setControllerObjectName ( string $controllerObjectName ) : void
$controllerObjectName string Object name of the controller which processes this request
return void

setDispatched() public method

Sets the dispatched flag
public setDispatched ( boolean $flag ) : void
$flag boolean If this request has been dispatched
return void

setExceedingArguments() public method

Sets the exceeding arguments
public setExceedingArguments ( array $exceedingArguments ) : void
$exceedingArguments array Numeric array of exceeding arguments
return void

Property Details

$arguments protected property

The arguments for this request
protected array $arguments
return array

$command protected property

protected Command,Neos\Flow\Cli $command
return Command

$commandLineArguments protected property

protected array $commandLineArguments
return array

$controllerCommandName protected property

protected string $controllerCommandName
return string

$controllerObjectName protected property

protected string $controllerObjectName
return string

$dispatched protected property

If this request has been changed and needs to be dispatched again
protected bool $dispatched
return boolean

$exceedingArguments protected property

protected array $exceedingArguments
return array