Arguments
class Arguments extends ArrayObject (View source)
A composite of controller arguments
Properties
protected array | $argumentNames | Names of the arguments contained by this object |
Methods
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.
Sets an argument, aliased to offsetSet()
Unsets an argument
Returns whether the requested index exists
Returns the value at the specified index
Creates, adds and returns a new controller argument to this composite object.
Returns an argument specified by name
Checks if an argument with the specified name exists
Returns the names of all arguments contained in this object
Magic setter method for the argument values. Each argument value can be set by just calling the setArgumentName() method.
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.
Remove all arguments and resets this object
Get all property mapping / validation errors
Details
void
offsetSet(mixed $offset, mixed $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.
void
append(mixed $value)
Sets an argument, aliased to offsetSet()
void
offsetUnset(mixed $offset)
Unsets an argument
bool
offsetExists(mixed $offset)
Returns whether the requested index exists
mixed
offsetGet(mixed $offset)
Returns the value at the specified index
Argument
addNewArgument(string $name, string $dataType = 'string', bool $isRequired = true, mixed $defaultValue = null, bool $mapRequestBody = false)
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.
void
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.
Argument
getArgument(string $argumentName)
Returns an argument specified by name
bool
hasArgument(string $argumentName)
Checks if an argument with the specified name exists
array
getArgumentNames()
Returns the names of all arguments contained in this object
void
__call(string $methodName, array $arguments)
Magic setter method for the argument values. Each argument value can be set by just calling the setArgumentName() method.
protected string
validateArgumentExistence(string $argumentName)
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.
void
removeAll()
Remove all arguments and resets this object
Result
getValidationResults()
Get all property mapping / validation errors