‪TYPO3CMS  11.5
TYPO3\CMS\Extbase\Mvc\Controller\Arguments Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Controller\Arguments:

Public Member Functions

 __construct ()
 
 offsetSet ($offset, $value)
 
 append ($value)
 
 offsetUnset ($offset)
 
bool offsetExists ($offset)
 
Argument offsetGet ($offset)
 
Argument addNewArgument ($name, $dataType='Text', $isRequired=false, $defaultValue=null)
 
 addArgument (Argument $argument)
 
Argument getArgument ($argumentName)
 
bool hasArgument ($argumentName)
 
array getArgumentNames ()
 
array getArgumentShortNames ()
 
 __call ($methodName, array $arguments)
 
 removeAll ()
 
TYPO3 CMS Extbase Error Result validate ()
 

Protected Member Functions

string translateToLongArgumentName ($argumentName)
 

Protected Attributes

array $argumentNames = array( )
 
array $argumentShortNames = array( )
 

Detailed Description

A composite of controller arguments

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 26 of file Arguments.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::__construct ( )

Constructor. If this one is removed, reflection breaks.

Definition at line 39 of file Arguments.php.

Member Function Documentation

◆ __call()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::__call (   $methodName,
array  $arguments 
)

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

Parameters
string$methodName‪Name of the method
array$arguments‪Method arguments
Exceptions

Definition at line 228 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\getArgumentNames(), and TYPO3\CMS\Extbase\Mvc\Controller\Arguments\translateToLongArgumentName().

◆ addArgument()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::addArgument ( Argument  $argument)

Adds the specified controller argument to this composite object. 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

Definition at line 163 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetSet().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Arguments\addNewArgument().

◆ addNewArgument()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Arguments::addNewArgument (   $name,
  $dataType = 'Text',
  $isRequired = false,
  $defaultValue = null 
)

Creates, adds and returns a new controller argument to this composite object. If an argument with the same name exists already, it will be replaced by the new argument object.

Parameters
string$name‪Name of the argument
string$dataType‪Name of one of the built-in data types
bool$isRequired‪TRUE if this argument should be marked as required
mixed$defaultValue‪Default value of the argument. Only makes sense if $isRequired==FALSE
Returns
Argument The new argument

Definition at line 145 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\addArgument().

◆ append()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::append (   $value)

Sets an argument, aliased to offsetSet()

Parameters
mixed$value‪The value
Exceptions

Definition at line 74 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetSet().

◆ getArgument()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Arguments::getArgument (   $argumentName)

Returns an argument specified by name

Parameters
string$argumentName‪Name of the argument to retrieve
Returns
Argument
Exceptions

Definition at line 175 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetExists(), and TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetGet().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService\initializePropertyMappingConfigurationFromRequest().

◆ getArgumentNames()

array TYPO3\CMS\Extbase\Mvc\Controller\Arguments::getArgumentNames ( )

Returns the names of all arguments contained in this object

Returns
‪array Argument names

Definition at line 200 of file Arguments.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Arguments\__call(), and TYPO3\CMS\Extbase\Mvc\Controller\Arguments\translateToLongArgumentName().

◆ getArgumentShortNames()

array TYPO3\CMS\Extbase\Mvc\Controller\Arguments::getArgumentShortNames ( )

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

Returns
‪array Argument short names

Definition at line 210 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\$argumentShortNames.

◆ hasArgument()

bool TYPO3\CMS\Extbase\Mvc\Controller\Arguments::hasArgument (   $argumentName)

Checks if an argument with the specified name exists

Parameters
string$argumentName‪Name of the argument to check for
Returns
‪bool TRUE if such an argument exists, otherwise FALSE
See also
offsetExists()

Definition at line 190 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetExists().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService\initializePropertyMappingConfigurationFromRequest().

◆ offsetExists()

bool TYPO3\CMS\Extbase\Mvc\Controller\Arguments::offsetExists (   $offset)

Returns whether the requested index exists

Parameters
mixed$offset‪Offset
Returns
‪bool
Todo:

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

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

Definition at line 109 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\translateToLongArgumentName().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Arguments\getArgument(), and TYPO3\CMS\Extbase\Mvc\Controller\Arguments\hasArgument().

◆ offsetGet()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Arguments::offsetGet (   $offset)

Returns the value at the specified index

Parameters
mixed$offset‪Offset
Returns
Argument The requested argument object
Exceptions

Definition at line 125 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\translateToLongArgumentName().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Arguments\getArgument().

◆ offsetSet()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::offsetSet (   $offset,
  $value 
)

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.

Parameters
mixed$offset‪Offset - not used here
mixed$value‪The argument
Exceptions

Definition at line 55 of file Arguments.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Arguments\addArgument(), and TYPO3\CMS\Extbase\Mvc\Controller\Arguments\append().

◆ offsetUnset()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::offsetUnset (   $offset)

Unsets an argument

Parameters
mixed$offset‪Offset
Todo:

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

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

Definition at line 90 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\translateToLongArgumentName().

◆ removeAll()

TYPO3\CMS\Extbase\Mvc\Controller\Arguments::removeAll ( )

Remove all arguments and resets this object

Definition at line 271 of file Arguments.php.

◆ translateToLongArgumentName()

string TYPO3\CMS\Extbase\Mvc\Controller\Arguments::translateToLongArgumentName (   $argumentName)
protected

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.

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

Parameters
string$argumentName‪argument name
Returns
‪string long argument name or empty string

Definition at line 254 of file Arguments.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Arguments\getArgumentNames().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Arguments\__call(), TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetExists(), TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetGet(), and TYPO3\CMS\Extbase\Mvc\Controller\Arguments\offsetUnset().

◆ validate()

TYPO3 CMS Extbase Error Result TYPO3\CMS\Extbase\Mvc\Controller\Arguments::validate ( )
Returns
‪\TYPO3\CMS\Extbase\Error\Result

Definition at line 282 of file Arguments.php.

Member Data Documentation

◆ $argumentNames

array TYPO3\CMS\Extbase\Mvc\Controller\Arguments::$argumentNames = array( )
protected

Names of the arguments contained by this object

Definition at line 30 of file Arguments.php.

◆ $argumentShortNames

array TYPO3\CMS\Extbase\Mvc\Controller\Arguments::$argumentShortNames = array( )
protected