‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Mvc\Controller\Argument Class Reference

Public Member Functions

 __construct ($name, $dataType)
 
string getName ()
 
Argument setShortName ($shortName)
 
string getShortName ()
 
string getDataType ()
 
Argument setRequired ($required)
 
bool isRequired ()
 
Argument setDefaultValue ($defaultValue)
 
mixed getDefaultValue ()
 
Argument setValidator (ValidatorInterface $validator)
 
ValidatorInterface getValidator ()
 
Argument setValue ($rawValue)
 
mixed getValue ()
 
MvcPropertyMappingConfiguration getPropertyMappingConfiguration ()
 
bool isValid ()
 
string __toString ()
 
 validate ()
 
 getValidationResults ()
 

Protected Attributes

MvcPropertyMappingConfiguration $propertyMappingConfiguration
 
string $name = ''
 
string $shortName
 
string $dataType
 
bool $isRequired = false
 
mixed null $value
 
mixed $defaultValue
 
ValidatorInterface $validator
 
Result $validationResults
 

Private Attributes

bool $hasBeenValidated = false
 

Detailed Description

A controller argument

Definition at line 26 of file Argument.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::__construct (   $name,
  $dataType 
)

Constructs this controller argument

Parameters
string$name‪Name of this argument
string$dataType‪The data type of this argument
Exceptions

Definition at line 91 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$dataType, TYPO3\CMS\Extbase\Mvc\Controller\Argument\$name, and TYPO3\CMS\Extbase\Utility\TypeHandlingUtility\normalizeType().

Member Function Documentation

◆ __toString()

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::__toString ( )

Returns a string representation of this argument's value

Returns
‪string

Definition at line 267 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$value.

◆ getDataType()

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::getDataType ( )

Returns the data type of this argument's value

Returns
‪string The data type

Definition at line 147 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$dataType.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\setArgumentValue().

◆ getDefaultValue()

mixed TYPO3\CMS\Extbase\Mvc\Controller\Argument::getDefaultValue ( )

Returns the default value of this argument

Returns
‪mixed The default value

Definition at line 191 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$defaultValue.

◆ getName()

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::getName ( )

Returns the name of this argument

Returns
‪string This argument's name

Definition at line 111 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$name.

◆ getPropertyMappingConfiguration()

MvcPropertyMappingConfiguration TYPO3\CMS\Extbase\Mvc\Controller\Argument::getPropertyMappingConfiguration ( )

◆ getShortName()

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::getShortName ( )

Returns the short name of this argument

Returns
‪string This argument's short name

Definition at line 137 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$shortName.

◆ getValidationResults()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::getValidationResults ( )

◆ getValidator()

ValidatorInterface TYPO3\CMS\Extbase\Mvc\Controller\Argument::getValidator ( )

Returns the set validator

Returns
‪ValidatorInterface The set validator, NULL if none was set

Definition at line 213 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$validator.

◆ getValue()

mixed TYPO3\CMS\Extbase\Mvc\Controller\Argument::getValue ( )

Returns the value of this argument

Returns
‪mixed The value of this argument - if none was set, NULL is returned

Definition at line 236 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$defaultValue, and TYPO3\CMS\Extbase\Mvc\Controller\Argument\$value.

◆ isRequired()

bool TYPO3\CMS\Extbase\Mvc\Controller\Argument::isRequired ( )

Returns TRUE if this argument is required

Returns
‪bool TRUE if this argument is required

Definition at line 169 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$isRequired.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\setArgumentValue(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\setRequired().

◆ isValid()

bool TYPO3\CMS\Extbase\Mvc\Controller\Argument::isValid ( )
Returns
‪bool TRUE if the argument is valid, FALSE otherwise

Definition at line 257 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\validate().

◆ setDefaultValue()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Argument::setDefaultValue (   $defaultValue)

Sets the default value of the argument

Parameters
mixed$defaultValue‪Default value
Returns
Argument $this

Definition at line 180 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$defaultValue.

◆ setRequired()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Argument::setRequired (   $required)

Marks this argument to be required

Parameters
bool$required‪TRUE if this argument should be required
Returns
Argument $this

Definition at line 158 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\isRequired().

◆ setShortName()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Argument::setShortName (   $shortName)

Sets the short name of this argument.

Parameters
string$shortName‪A "short name" - a single character
Returns
Argument $this
Exceptions

Definition at line 123 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$shortName.

◆ setValidator()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Argument::setValidator ( ValidatorInterface  $validator)

Sets a custom validator which is used supplementary to the base validation

Parameters
ValidatorInterface$validator‪The actual validator object
Returns
Argument Returns $this (used for fluent interface)

Definition at line 202 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$validator.

◆ setValue()

Argument TYPO3\CMS\Extbase\Mvc\Controller\Argument::setValue (   $rawValue)

Sets the value of this argument.

Parameters
mixed$rawValue‪The value of this argument
Returns
Argument

Definition at line 225 of file Argument.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\setArgumentValue().

◆ validate()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::validate ( )

Member Data Documentation

◆ $dataType

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::$dataType
protected

Data type of this argument's value

Definition at line 48 of file Argument.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\__construct(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\getDataType().

◆ $defaultValue

mixed TYPO3\CMS\Extbase\Mvc\Controller\Argument::$defaultValue
protected

◆ $hasBeenValidated

bool TYPO3\CMS\Extbase\Mvc\Controller\Argument::$hasBeenValidated = false
private

Definition at line 82 of file Argument.php.

◆ $isRequired

bool TYPO3\CMS\Extbase\Mvc\Controller\Argument::$isRequired = false
protected

TRUE if this argument is required

Definition at line 54 of file Argument.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\isRequired().

◆ $name

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::$name = ''
protected

◆ $propertyMappingConfiguration

MvcPropertyMappingConfiguration TYPO3\CMS\Extbase\Mvc\Controller\Argument::$propertyMappingConfiguration
protected

◆ $shortName

string TYPO3\CMS\Extbase\Mvc\Controller\Argument::$shortName
protected

◆ $validationResults

Result TYPO3\CMS\Extbase\Mvc\Controller\Argument::$validationResults
protected

The validation results. This can be asked if the argument has errors.

Definition at line 78 of file Argument.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\getValidationResults(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\validate().

◆ $validator

ValidatorInterface TYPO3\CMS\Extbase\Mvc\Controller\Argument::$validator
protected

A custom validator, used supplementary to the base validation

Definition at line 72 of file Argument.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\getValidator(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\setValidator().

◆ $value

mixed null TYPO3\CMS\Extbase\Mvc\Controller\Argument::$value
protected

Actual value of this argument

Definition at line 60 of file Argument.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\__toString(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\getValue().