Arguments extends ArrayObject

A composite of controller arguments

Internal

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()  : mixed
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
Returns whether the requested index exists
offsetGet()  : Argument
Returns the value at the specified index
offsetSet()  : mixed
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()  : mixed
Unsets an argument
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
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) : 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) : mixed
Parameters
$value : mixed

The value

Tags
throws
InvalidArgumentException

if the argument is not a valid Controller Argument object

todo

Set parameter type for $value to mixed or correct union type as breaking change in v12.

todo

Set return type to void as breaking change in v12 and remove #[\ReturnTypeWillChange].

Attributes
#[ReturnTypeWillChange]

getArgumentNames()

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
see
offsetExists()
Return values
bool

TRUE if such an argument exists, otherwise FALSE

offsetExists()

Returns whether the requested index exists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed

Offset

Tags
todo

Set parameter type for $offset to mixed or correct union type as breaking change in v12.

todo

Set return type to bool as breaking change in v12 and remove #[\ReturnTypeWillChange].

Attributes
#[ReturnTypeWillChange]
Return values
bool

offsetGet()

Returns the value at the specified index

public offsetGet(mixed $offset) : Argument
Parameters
$offset : mixed

Offset

Tags
throws
NoSuchArgumentException

if the argument does not exist

todo

Set parameter type for $offset to mixed as breaking change in v12.

todo

Set return type to mixed as breaking change in v12 and remove #[\ReturnTypeWillChange].

Attributes
#[ReturnTypeWillChange]
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) : mixed
Parameters
$offset : mixed

Offset - not used here

$value : mixed

The argument

Tags
throws
InvalidArgumentException

if the argument is not a valid Controller Argument object

todo

Set parameter type for $offset and $value to mixed or correct union type as breaking change in v12.

todo

Set return type to mixed as breaking change in v12 and remove #[\ReturnTypeWillChange].

Attributes
#[ReturnTypeWillChange]

offsetUnset()

Unsets an argument

public offsetUnset(mixed $offset) : mixed
Parameters
$offset : mixed

Offset

Tags
todo

Set parameter type for $offset to mixed or correct union type as breaking change in v12.

todo

Set return type to void as breaking change in v12 and remove #[\ReturnTypeWillChange].

Attributes
#[ReturnTypeWillChange]

removeAll()

Remove all arguments and resets this object

public removeAll() : mixed

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

argument name

Return values
string

long argument name or empty string


        
On this page

Search results