TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Controller\Argument Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Controller\Argument:
Tx_Extbase_MVC_Controller_Argument

Public Member Functions

 __construct ($name, $dataType)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 injectTypeHandlingService (\TYPO3\CMS\Extbase\Service\TypeHandlingService $typeHandlingService)
 
 getName ()
 
 setShortName ($shortName)
 
 getShortName ()
 
 setDataType ($dataType)
 
 getDataType ()
 
 setRequired ($required)
 
 isRequired ()
 
 setDefaultValue ($defaultValue)
 
 getDefaultValue ()
 
 setValidator (\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator)
 
 setNewValidatorConjunction (array $objectNames)
 
 getValidator ()
 
 getOrigin ()
 
 setValue ($rawValue)
 
 getValue ()
 
 isValue ()
 
 getPropertyMappingConfiguration ()
 
 isValid ()
 
 getValidationResults ()
 
 __toString ()
 

Public Attributes

const ORIGIN_CLIENT = 0
 
const ORIGIN_PERSISTENCE = 1
 
const ORIGIN_PERSISTENCE_AND_MODIFIED = 2
 
const ORIGIN_NEWLY_CREATED = 3
 

Protected Member Functions

 transformValue ($value)
 
 findObjectByUid ($uid)
 

Protected Attributes

 $objectManager
 
 $queryFactory
 
 $configurationManager
 
 $deprecatedPropertyMapper
 
 $propertyMapper
 
 $propertyMappingConfiguration
 
 $reflectionService
 
 $typeHandlingService
 
 $name = ''
 
 $shortName = NULL
 
 $dataType = NULL
 
 $dataTypeClassSchema
 
 $isRequired = FALSE
 
 $value = NULL
 
 $defaultValue = NULL
 
 $validator = NULL
 
 $validationResults = NULL
 
 $uid = NULL
 
 $origin = 0
 
 $persistenceManager
 

Detailed Description

A controller argument

Definition at line 24 of file Argument.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructs this controller argument

Parameters
string$nameName of this argument
string$dataTypeThe data type of this argument
Exceptions

Definition at line 174 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$dataType, and TYPO3\CMS\Extbase\Mvc\Controller\Argument\$name.

Member Function Documentation

◆ __toString()

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

Returns a string representation of this argument's value

Returns
string

Definition at line 510 of file Argument.php.

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

◆ findObjectByUid()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::findObjectByUid (   $uid)
protected

Finds an object from the repository by searching for its technical UID.

Parameters
integer$uidThe object's uid
Returns
object Either the object matching the uid or, if none or more than one object was found, NULL

Definition at line 447 of file Argument.php.

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

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

◆ getDataType()

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

Returns the data type of this argument's value

Returns
string The data type

Definition at line 259 of file Argument.php.

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

◆ getDefaultValue()

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

Returns the default value of this argument

Returns
mixed The default value

Definition at line 303 of file Argument.php.

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

◆ getName()

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

Returns the name of this argument

Returns
string This argument's name

Definition at line 210 of file Argument.php.

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

◆ getOrigin()

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

Get the origin of the argument value. This is only meaningful after argument mapping.

Returns
integer one of the ORIGIN_* constants
Deprecated:
since Extbase 1.4.0, will be removed two versions after Extbase 6.1

Definition at line 356 of file Argument.php.

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

◆ getPropertyMappingConfiguration()

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

Return the Property Mapping Configuration used for this argument; can be used by the initialize*action to modify the Property Mapping.

Returns

Definition at line 484 of file Argument.php.

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

◆ getShortName()

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

Returns the short name of this argument

Returns
string This argument's short name

Definition at line 236 of file Argument.php.

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

◆ getValidationResults()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::getValidationResults ( )
Returns
array<> Validation errors which have occurred.

Definition at line 500 of file Argument.php.

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

◆ getValidator()

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

Returns the set validator

Returns
The set validator, NULL if none was set

Definition at line 346 of file Argument.php.

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

◆ getValue()

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

Returns the value of this argument

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

Definition at line 460 of file Argument.php.

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

◆ injectReflectionService()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::injectReflectionService ( \TYPO3\CMS\Extbase\Reflection\ReflectionService  $reflectionService)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService
Returns
void

Definition at line 189 of file Argument.php.

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

◆ injectTypeHandlingService()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::injectTypeHandlingService ( \TYPO3\CMS\Extbase\Service\TypeHandlingService  $typeHandlingService)
Parameters
\TYPO3\CMS\Extbase\Service\TypeHandlingService$typeHandlingService
Returns
void

Definition at line 199 of file Argument.php.

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

◆ isRequired()

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

Returns TRUE if this argument is required

Returns
boolean TRUE if this argument is required

Definition at line 281 of file Argument.php.

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

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\setRequired(), TYPO3\CMS\Extbase\Mvc\Controller\Argument\setValue(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\transformValue().

◆ isValid()

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

Definition at line 492 of file Argument.php.

◆ isValue()

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

Checks if this argument has a value set.

Returns
boolean TRUE if a value was set, otherwise FALSE
Deprecated:
since Extbase 1.4.0, will be removed two versions after Extbase 6.1

Definition at line 474 of file Argument.php.

◆ setDataType()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::setDataType (   $dataType)

Sets the data type of this argument's value

Parameters
string$dataTypeThe data type. Can be either a built-in type such as "Text" or "Integer" or a fully qualified object name
Returns
$this

Definition at line 247 of file Argument.php.

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

◆ setDefaultValue()

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

Sets the default value of the argument

Parameters
mixed$defaultValueDefault value
Returns
$this

Definition at line 292 of file Argument.php.

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

◆ setNewValidatorConjunction()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::setNewValidatorConjunction ( array  $objectNames)

Create and set a validator chain

Parameters
array$objectNamesObject names of the validators
Returns
Returns $this (used for fluent interface)
Deprecated:
since Extbase 1.4.0, will be removed two versions after Extbase 6.1

Definition at line 327 of file Argument.php.

◆ setRequired()

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

Marks this argument to be required

Parameters
boolean$requiredTRUE if this argument should be required
Returns
$this

Definition at line 270 of file Argument.php.

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

◆ setShortName()

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

Sets the short name of this argument.

Parameters
string$shortNameA "short name" - a single character
Exceptions

Definition at line 222 of file Argument.php.

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

◆ setValidator()

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

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

Parameters
\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface$validatorThe actual validator object
Returns
Returns $this (used for fluent interface)

Definition at line 314 of file Argument.php.

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

◆ setValue()

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

Sets the value of this argument.

Parameters
mixed$rawValueThe value of this argument
Returns
Exceptions

Definition at line 367 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$dataType, TYPO3\CMS\Extbase\Mvc\Controller\Argument\isRequired(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\transformValue().

◆ transformValue()

TYPO3\CMS\Extbase\Mvc\Controller\Argument::transformValue (   $value)
protected

Checks if the value is a UUID or an array but should be an object, i.e. the argument's data type class schema is set. If that is the case, this method tries to look up the corresponding object instead.

Additionally, it maps arrays to objects in case it is a normal object.

Parameters
mixed$valueThe value of an argument
Exceptions

Definition at line 414 of file Argument.php.

References TYPO3\CMS\Extbase\Mvc\Controller\Argument\$value, TYPO3\CMS\Extbase\Mvc\Controller\Argument\findObjectByUid(), and TYPO3\CMS\Extbase\Mvc\Controller\Argument\isRequired().

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

Member Data Documentation

◆ $configurationManager

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$configurationManager
protected

Definition at line 42 of file Argument.php.

◆ $dataType

◆ $dataTypeClassSchema

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$dataTypeClassSchema
protected

Definition at line 102 of file Argument.php.

◆ $defaultValue

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$defaultValue = NULL
protected

◆ $deprecatedPropertyMapper

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$deprecatedPropertyMapper
protected

Definition at line 50 of file Argument.php.

◆ $isRequired

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

Definition at line 109 of file Argument.php.

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

◆ $name

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

◆ $objectManager

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$objectManager
protected

Definition at line 30 of file Argument.php.

◆ $origin

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$origin = 0
protected

Definition at line 158 of file Argument.php.

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

◆ $persistenceManager

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$persistenceManager
protected

Definition at line 164 of file Argument.php.

◆ $propertyMapper

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$propertyMapper
protected

Definition at line 58 of file Argument.php.

◆ $propertyMappingConfiguration

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

◆ $queryFactory

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$queryFactory
protected

Definition at line 36 of file Argument.php.

◆ $reflectionService

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$reflectionService
protected

◆ $shortName

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$shortName = NULL
protected

◆ $typeHandlingService

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$typeHandlingService
protected

◆ $uid

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$uid = NULL
protected

◆ $validationResults

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$validationResults = NULL
protected

◆ $validator

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$validator = NULL
protected

◆ $value

TYPO3\CMS\Extbase\Mvc\Controller\Argument::$value = NULL
protected

◆ ORIGIN_CLIENT

const TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_CLIENT = 0

Definition at line 146 of file Argument.php.

◆ ORIGIN_NEWLY_CREATED

const TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_NEWLY_CREATED = 3

◆ ORIGIN_PERSISTENCE

const TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE = 1

◆ ORIGIN_PERSISTENCE_AND_MODIFIED

const TYPO3\CMS\Extbase\Mvc\Controller\Argument::ORIGIN_PERSISTENCE_AND_MODIFIED = 2