‪TYPO3CMS  ‪main
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)
 
 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 ()
 
 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 28 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 41 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 210 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 145 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 127 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 70 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
NoSuchArgumentException

Definition at line 157 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 182 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 192 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 172 of file Arguments.php.

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

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

◆ offsetExists()

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

◆ 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
NoSuchArgumentException‪if the argument does not exist

Definition at line 107 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 54 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)
Parameters
mixed$offset

Definition at line 81 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 253 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 236 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\Mvc\Controller\Arguments::validate ( )

Definition at line 261 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 32 of file Arguments.php.

◆ $argumentShortNames

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