Arguments

class \TYPO3\CMS\Extbase\Mvc\Controller\Arguments

Extends
ArrayObject

A composite of controller arguments

Table of Contents

Properties

$argumentNames  : array
$argumentShortNames  : array

Methods

__call()  : void
Magic setter method for the argument values. Each argument value can be set by just calling the setArgumentName() method.
__construct()  : mixed
Constructor. If this one is removed, reflection breaks.
addArgument()  : void
Adds the specified controller argument to this composite object.
addNewArgument()  : Argument
Creates, adds and returns a new controller argument to this composite object.
append()  : void
Sets an argument, aliased to offsetSet()
getArgument()  : Argument
Returns an argument specified by name
getArgumentNames()  : array
Returns the names of all arguments contained in this object
getArgumentShortNames()  : array
Returns the short names of all arguments contained in this object that have one.
hasArgument()  : bool
Checks if an argument with the specified name exists
offsetExists()  : bool
offsetGet()  : Argument
Returns the value at the specified index
offsetSet()  : void
Adds or replaces the argument specified by $value. The argument's name is taken from the argument object itself, therefore the $offset does not have any meaning in this context.
offsetUnset()  : void
removeAll()  : void
Remove all arguments and resets this object
validate()  : Result
translateToLongArgumentName()  : string
Translates a short argument name to its corresponding long name. If the specified argument name is a real argument name already, it will be returned again.

Properties

$argumentNames

protected array $argumentNames = []

$argumentShortNames

protected array $argumentShortNames = []

Methods

__call()

Magic setter method for the argument values. Each argument value can be set by just calling the setArgumentName() method.

public __call(string $methodName, array $arguments) : void

Parameters

$methodName : string
$arguments : array

Tags

throws
LogicException

__construct()

Constructor. If this one is removed, reflection breaks.

public __construct() : mixed

addArgument()

Adds the specified controller argument to this composite object.

public addArgument(Argument $argument) : void

If an argument with the same name exists already, it will be replaced by the new argument object.

Note that the argument will be cloned, not referenced.

Parameters

$argument : Argument

addNewArgument()

Creates, adds and returns a new controller argument to this composite object.

public addNewArgument(string $name[, string $dataType = 'Text' ][, bool $isRequired = false ][, mixed $defaultValue = null ]) : Argument

If an argument with the same name exists already, it will be replaced by the new argument object.

Parameters

$name : string
$dataType : string = 'Text'
$isRequired : bool = false
$defaultValue : mixed = null

Return values

Argument

append()

Sets an argument, aliased to offsetSet()

public append(mixed $value) : void

Parameters

$value : mixed

Tags

throws
InvalidArgumentException

if the argument is not a valid Controller Argument object

getArgumentNames()

Returns the names of all arguments contained in this object

public getArgumentNames() : array

Return values

array

getArgumentShortNames()

Returns the short names of all arguments contained in this object that have one.

public getArgumentShortNames() : array

Return values

array

hasArgument()

Checks if an argument with the specified name exists

public hasArgument(string $argumentName) : bool

Parameters

$argumentName : string

Tags

see
offsetExists()

Return values

bool

offsetExists()

public offsetExists(mixed $offset) : bool

Parameters

$offset : mixed

Return values

bool

offsetSet()

Adds or replaces the argument specified by $value. The argument's name is taken from the argument object itself, therefore the $offset does not have any meaning in this context.

public offsetSet(mixed $offset, mixed $value) : void

Parameters

$offset : mixed

Offset - not used here

$value : mixed

Tags

throws
InvalidArgumentException

if the argument is not a valid Controller Argument object

offsetUnset()

public offsetUnset(mixed $offset) : void

Parameters

$offset : mixed

removeAll()

Remove all arguments and resets this object

public removeAll() : void

translateToLongArgumentName()

Translates a short argument name to its corresponding long name. If the specified argument name is a real argument name already, it will be returned again.

protected translateToLongArgumentName(string $argumentName) : string

If an argument with the specified name or short name does not exist, an empty string is returned.

Parameters

$argumentName : string

Return values

string
On this page