Argument
class Argument (View source)
A controller argument
Properties
protected string | $name | Name of this argument |
|
protected string | $dataType | Data type of this argument's value |
|
protected bool | $isRequired | true if this argument is required |
|
protected object|null | $value | Actual value of this argument |
|
protected mixed | $defaultValue | Default value. Used if argument is optional. |
|
protected ValidatorInterface|null | $validator | A custom validator, used supplementary to the base validation |
|
protected Result | $validationResults | The validation results. This can be asked if the argument has errors. |
|
protected bool | $mapRequestBody | If the request body should be mapped into this argument. |
|
protected MvcPropertyMappingConfiguration | $propertyMappingConfiguration | ||
protected PropertyMapper | $propertyMapper |
Methods
Constructs this controller argument
Returns the name of this argument
Returns the data type of this argument's value
Marks this argument to be required
Returns true if this argument is required
Sets the default value of the argument
Returns the default value of this argument
Sets a custom validator which is used supplementary to the base validation
Returns the set validator
Returns the value of this argument. If the value is NULL, we use the defaultValue.
Return the Property Mapping Configuration used for this argument; can be used by the initialize*action to modify the Property Mapping.
No description
No description
Set if the request body should be mapped into this argument.
Details
__construct(string $name, string $dataType)
Constructs this controller argument
string
getName()
Returns the name of this argument
string
getDataType()
Returns the data type of this argument's value
Argument
setRequired(bool $required)
Marks this argument to be required
bool
isRequired()
Returns true if this argument is required
Argument
setDefaultValue(mixed $defaultValue)
Sets the default value of the argument
mixed
getDefaultValue()
Returns the default value of this argument
Argument
setValidator(ValidatorInterface $validator)
Sets a custom validator which is used supplementary to the base validation
ValidatorInterface|null
getValidator()
Returns the set validator
Argument
setValue(mixed $rawValue)
Sets the value of this argument.
object
getValue()
Returns the value of this argument. If the value is NULL, we use the defaultValue.
MvcPropertyMappingConfiguration
getPropertyMappingConfiguration()
Return the Property Mapping Configuration used for this argument; can be used by the initialize*action to modify the Property Mapping.
Result|null
getValidationResults()
No description
bool
getMapRequestBody()
No description
Argument
setMapRequestBody(bool $mapRequestBody)
Set if the request body should be mapped into this argument.