Arguments extends ArrayObject
A composite of controller arguments
only to be used within Extbase, not part of TYPO3 Core API.
Table of Contents
Properties
- $argumentNames : array<string|int, mixed>
- $argumentShortNames : array<string|int, mixed>
Methods
- __call() : mixed
- 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() : mixed
- 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<string|int, mixed>
- Returns the names of all arguments contained in this object
- getArgumentShortNames() : array<string|int, mixed>
- 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() : mixed
- 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<string|int, mixed>
$argumentNames
= []
Names of the arguments contained by this object
$argumentShortNames
protected
array<string|int, mixed>
$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<string|int, mixed> $arguments) : mixed
Parameters
- $methodName : string
-
Name of the method
- $arguments : array<string|int, mixed>
-
Method arguments
Tags
__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) : mixed
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
-
The argument to add
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
-
Name of the argument
- $dataType : string = 'Text'
-
Name of one of the built-in data types
- $isRequired : bool = false
-
TRUE if this argument should be marked as required
- $defaultValue : mixed = null
-
Default value of the argument. Only makes sense if $isRequired==FALSE
Return values
Argument —The new argument
append()
Sets an argument, aliased to offsetSet()
public
append(mixed $value) : void
Parameters
- $value : mixed
-
The value
Tags
getArgument()
Returns an argument specified by name
public
getArgument(string $argumentName) : Argument
Parameters
- $argumentName : string
-
Name of the argument to retrieve
Tags
Return values
ArgumentgetArgumentNames()
Returns the names of all arguments contained in this object
public
getArgumentNames() : array<string|int, mixed>
Return values
array<string|int, mixed> —Argument names
getArgumentShortNames()
Returns the short names of all arguments contained in this object that have one.
public
getArgumentShortNames() : array<string|int, mixed>
Return values
array<string|int, mixed> —Argument short names
hasArgument()
Checks if an argument with the specified name exists
public
hasArgument(string $argumentName) : bool
Parameters
- $argumentName : string
-
Name of the argument to check for
Tags
Return values
bool —TRUE if such an argument exists, otherwise FALSE
offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
Returns the value at the specified index
public
offsetGet(mixed $offset) : Argument
Parameters
- $offset : mixed
-
Offset
Tags
Return values
Argument —The requested argument object
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
-
The argument
Tags
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
removeAll()
Remove all arguments and resets this object
public
removeAll() : mixed
validate()
public
validate() : Result
Return values
ResulttranslateToLongArgumentName()
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
-
argument name
Return values
string —long argument name or empty string