PHP Class Neos\Flow\Mvc\ActionRequest

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

Protected Properties

Property Type Description
$argumentNamespace string An optional namespace for arguments of this request. Used, for example, in plugins and widgets.
$arguments array The arguments for this request. They must be only simple types, no objects allowed.
$controllerActionName string Name of the action the controller is supposed to take.
$controllerName string Object name of the controller which is supposed to handle this request.
$controllerPackageKey string Package key of the controller which is supposed to handle this request.
$controllerSubpackageKey string Subpackage key of the controller which is supposed to handle this request.
$dispatched boolean If this request has been changed and needs to be dispatched again
$format string The requested representation format
$hashService Neos\Flow\Security\Cryptography\HashService
$internalArguments array All framework-internal arguments start with double underscore (__), and are only used from within the framework. Not for user consumption. Internal Arguments can be objects, in contrast to public arguments.
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$packageManager Neos\Flow\Package\PackageManagerInterface
$parentRequest ActionRequest | Request The parent request – either another ActionRequest or Http Request
$pluginArguments array Arguments and configuration for plugins – including widgets – which are sub controllers to the controller referred to by this request.
$referringRequest ActionRequest Cached pointer to a request referring to this one (if any)
$rootRequest object Cached pointer to the root request (usually an HTTP request)

Public Methods

Method Description
__clone ( ) Resets the dispatched status to FALSE
__construct ( ActionRequest | Request $parentRequest ) Constructs this action request
__sleep ( ) : array We provide our own __sleep method, where we serialize all properties *except* the parentRequest if it is a HTTP request -- as this one contains $_SERVER etc.
getArgument ( string $argumentName ) : string Returns the value of the specified argument
getArgumentNamespace ( ) : string Returns the argument namespace, if any.
getArguments ( ) : array Returns an Array of arguments and their values
getControllerActionName ( ) : string Returns the name of the action the controller is supposed to execute.
getControllerName ( ) : string Returns the object name of the controller supposed to handle this request, if one was set already (if not, the name of the default controller is returned)
getControllerObjectName ( ) : string Returns the object name of the controller defined by the package key and controller name
getControllerPackageKey ( ) : string Returns the package key of the specified controller.
getControllerSubpackageKey ( ) : string Returns the subpackage key of the specified controller.
getFormat ( ) : string Returns the requested representation format
getHttpRequest ( ) : Request Returns the top level request: the HTTP request object
getInternalArgument ( string $argumentName ) : string Returns the value of the specified internal argument.
getInternalArguments ( ) : array Returns the internal arguments of the request, that is, all arguments whose name starts with two underscores.
getMainRequest ( ) : ActionRequest Returns the top level ActionRequest: the one just below the HTTP request
getParentRequest ( ) : ActionRequest | Request Returns the parent request
getPluginArguments ( ) : array Returns an array of plugin argument configurations
getReferringRequest ( ) : ActionRequest Returns an ActionRequest which referred to this request, if any.
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 Checks if this request is the uppermost ActionRequest, just one below the HTTP request.
setArgument ( string $argumentName, mixed $value ) : void Sets the value of the specified argument
setArgumentNamespace ( string $namespace ) : void Sets a namespace for the arguments of this request.
setArguments ( array $arguments ) : void Sets the specified arguments.
setControllerActionName ( string $actionName ) : void Sets the name of the action contained in this request.
setControllerName ( string $controllerName ) : void Sets the name of the controller which is supposed to handle the request.
setControllerObjectName ( string $unknownCasedControllerObjectName ) : void Explicitly sets the object name of the controller
setControllerPackageKey ( string $packageKey ) : void Sets the package key of the controller.
setControllerSubpackageKey ( string $subpackageKey ) : void Sets the subpackage key of the controller.
setDispatched ( boolean $flag ) : void Sets the dispatched flag
setFormat ( string $format ) : void Sets the requested representation format

Protected Methods

Method Description
emitRequestDispatched ( ActionRequest $request ) : void Emits a signal when a Request has been dispatched

Method Details

__clone() public method

Resets the dispatched status to FALSE
public __clone ( )

__construct() public method

Constructs this action request
public __construct ( ActionRequest | Request $parentRequest )
$parentRequest ActionRequest | Request Either an HTTP request or another ActionRequest

__sleep() public method

We provide our own __sleep method, where we serialize all properties *except* the parentRequest if it is a HTTP request -- as this one contains $_SERVER etc.
public __sleep ( ) : array
return array

emitRequestDispatched() protected method

The action request is not proxyable, so the signal is dispatched manually here. The safeguard allows unit tests without the dispatcher dependency.
protected emitRequestDispatched ( ActionRequest $request ) : void
$request ActionRequest
return void

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

getArgumentNamespace() public method

Returns the argument namespace, if any.
public getArgumentNamespace ( ) : string
return string

getArguments() public method

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

getControllerActionName() public method

Returns the name of the action the controller is supposed to execute.
public getControllerActionName ( ) : string
return string Action name

getControllerName() public method

Returns the object name of the controller supposed to handle this request, if one was set already (if not, the name of the default controller is returned)
public getControllerName ( ) : string
return string Name of the controller

getControllerObjectName() public method

Returns the object name of the controller defined by the package key and controller name
public getControllerObjectName ( ) : string
return string The controller's Object Name

getControllerPackageKey() public method

Returns the package key of the specified controller.
public getControllerPackageKey ( ) : string
return string The package key

getControllerSubpackageKey() public method

If there is no subpackage key set, the method returns NULL.
public getControllerSubpackageKey ( ) : string
return string The subpackage key

getFormat() public method

Returns the requested representation format
public getFormat ( ) : string
return string The desired format, something like "html", "xml", "png", "json" or the like.

getHttpRequest() public method

Returns the top level request: the HTTP request object
public getHttpRequest ( ) : Request
return Neos\Flow\Http\Request

getInternalArgument() public method

Internal arguments are set via setArgument(). In order to be handled as an internal argument, its name must start with two underscores.
public getInternalArgument ( string $argumentName ) : string
$argumentName string Name of the argument, for example "__fooBar"
return string Value of the argument, or NULL if not set.

getInternalArguments() public method

Returns the internal arguments of the request, that is, all arguments whose name starts with two underscores.
public getInternalArguments ( ) : array
return array

getMainRequest() public method

Returns the top level ActionRequest: the one just below the HTTP request
public getMainRequest ( ) : ActionRequest
return ActionRequest

getParentRequest() public method

Returns the parent request
public getParentRequest ( ) : ActionRequest | Request
return ActionRequest | Request

getPluginArguments() public method

Returns an array of plugin argument configurations
public getPluginArguments ( ) : array
return array

getReferringRequest() public method

The referring request is not set or determined automatically but must be explicitly set through the corresponding internal argument "__referrer". This mechanism is used by Flow's form and validation mechanisms.
public getReferringRequest ( ) : ActionRequest
return ActionRequest the referring request, or NULL if no referrer found

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

Checks if this request is the uppermost ActionRequest, just one below the HTTP request.
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

setArgumentNamespace() public method

This doesn't affect the actual behavior of argument handling within this classes' methods but is used in other parts of Flow and its libraries to render argument names which don't conflict with each other.
public setArgumentNamespace ( string $namespace ) : void
$namespace string Argument namespace
return void

setArguments() public method

The arguments array will be reset therefore any arguments which existed before will be overwritten!
public setArguments ( array $arguments ) : void
$arguments array An array of argument names and their values
return void

setControllerActionName() public method

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

setControllerName() public method

Note: This is not the object name of the controller! Examples: "Standard", "Account", ...
public setControllerName ( string $controllerName ) : void
$controllerName string Name of the controller
return void

setControllerObjectName() public method

Explicitly sets the object name of the controller
public setControllerObjectName ( string $unknownCasedControllerObjectName ) : void
$unknownCasedControllerObjectName string The fully qualified controller object name
return void

setControllerPackageKey() public method

This function tries to determine the correct case for the given package key. If the Package Manager does not know the specified package, the package key cannot be verified or corrected and is stored as is.
public setControllerPackageKey ( string $packageKey ) : void
$packageKey string The package key
return void

setControllerSubpackageKey() public method

Sets the subpackage key of the controller.
public setControllerSubpackageKey ( string $subpackageKey ) : void
$subpackageKey string The subpackage key.
return void

setDispatched() public method

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

setFormat() public method

Sets the requested representation format
public setFormat ( string $format ) : void
$format string The desired format, something like "html", "xml", "png", "json" or the like. Can even be something like "rss.xml".
return void

Property Details

$argumentNamespace protected property

An optional namespace for arguments of this request. Used, for example, in plugins and widgets.
protected string $argumentNamespace
return string

$arguments protected property

The arguments for this request. They must be only simple types, no objects allowed.
protected array $arguments
return array

$controllerActionName protected property

Name of the action the controller is supposed to take.
protected string $controllerActionName
return string

$controllerName protected property

Object name of the controller which is supposed to handle this request.
protected string $controllerName
return string

$controllerPackageKey protected property

Package key of the controller which is supposed to handle this request.
protected string $controllerPackageKey
return string

$controllerSubpackageKey protected property

Subpackage key of the controller which is supposed to handle this request.
protected string $controllerSubpackageKey
return string

$dispatched protected property

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

$format protected property

The requested representation format
protected string $format
return string

$hashService protected property

protected HashService,Neos\Flow\Security\Cryptography $hashService
return Neos\Flow\Security\Cryptography\HashService

$internalArguments protected property

All framework-internal arguments start with double underscore (__), and are only used from within the framework. Not for user consumption. Internal Arguments can be objects, in contrast to public arguments.
protected array $internalArguments
return array

$objectManager protected property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$packageManager protected property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface

$parentRequest protected property

The parent request – either another ActionRequest or Http Request
protected ActionRequest,Neos\Flow\Mvc|Request,Neos\Flow\Http $parentRequest
return ActionRequest | Request

$pluginArguments protected property

Arguments and configuration for plugins – including widgets – which are sub controllers to the controller referred to by this request.
protected array $pluginArguments
return array

$referringRequest protected property

Cached pointer to a request referring to this one (if any)
protected ActionRequest,Neos\Flow\Mvc $referringRequest
return ActionRequest

$rootRequest protected property

Cached pointer to the root request (usually an HTTP request)
protected object $rootRequest
return object