Detailed Description
Messages are sent between Controllers and are used to transfer data between them.
They are are dispatched by ActionMapper, which decides upon the message's controller, context and action parameter to which Controller it will be send.
Definition at line 23 of file ControllerMessage.php.
Public Member Functions | |
setSender ($sender) | |
getSender () | |
setContext ($context) | |
getContext () | |
setAction ($action) | |
getAction () | |
setFormat ($format) | |
getFormat () | |
setHeader ($name, $value) | |
setHeaders (array $headers) | |
getHeader ($name, $default=null) | |
getHeaders () | |
clearHeader ($name) | |
clearHeaders () | |
hasHeader ($name) | |
setValue ($name, $value) | |
setValues (array $values) | |
getValue ($name, $default=null, $validateDesc=null, $suppressException=false) | |
getBooleanValue ($name, $default=false) | |
getValues () | |
clearValue ($name) | |
clearValues () | |
hasValue ($name) | |
setProperty ($name, $value) | |
getProperty ($name) | |
addError (ApplicationError $error) | |
setErrors (array $errors) | |
getErrors () | |
clearErrors () | |
hasErrors () | |
Member Function Documentation
◆ setSender()
setSender | ( | $sender | ) |
Set the name of the sending Controller.
- Parameters
-
$sender The name of the Controller
Implemented in AbstractControllerMessage.
◆ getSender()
getSender | ( | ) |
Get the name of the sending Controller.
- Returns
- The name of the Controller
Implemented in AbstractControllerMessage.
◆ setContext()
setContext | ( | $context | ) |
Set the name of the context.
- Parameters
-
$context The name of the context
Implemented in AbstractControllerMessage.
◆ getContext()
getContext | ( | ) |
Get the name of the context.
- Returns
- The name of the context
Implemented in AbstractControllerMessage.
◆ setAction()
setAction | ( | $action | ) |
Set the name of the action.
- Parameters
-
$action The name of the action
Implemented in AbstractControllerMessage.
◆ getAction()
getAction | ( | ) |
◆ setFormat()
setFormat | ( | $format | ) |
Set the message format.
- Parameters
-
$format A key of the configuration section 'Formats'
Implemented in AbstractControllerMessage.
◆ getFormat()
getFormat | ( | ) |
Get the message format.
If no explicit format is set, the format is derived from the Content-Type header value, if existing. If no format can be derived, the first format in the configuration section 'Formats' will be used.
- Returns
- String
Implemented in AbstractControllerMessage.
◆ setHeader()
setHeader | ( | $name, | |
$value | |||
) |
Set a header value.
- Parameters
-
$name The header name $value The header value
Implemented in AbstractControllerMessage.
◆ setHeaders()
setHeaders | ( | array | $headers | ) |
Set all headers at once.
- Parameters
-
$headers The associative array
Implemented in AbstractControllerMessage.
◆ getHeader()
getHeader | ( | $name, | |
$default = null |
|||
) |
Get a header value.
- Parameters
-
$name The header name $default The default value if the header is not defined (default: null)
- Returns
- The header value or default, if it does not exist
Implemented in AbstractControllerMessage.
◆ getHeaders()
getHeaders | ( | ) |
◆ clearHeader()
clearHeader | ( | $name | ) |
◆ clearHeaders()
clearHeaders | ( | ) |
Remove all headers.
Implemented in AbstractControllerMessage.
◆ hasHeader()
hasHeader | ( | $name | ) |
Check for existence of a header.
- Parameters
-
$name The name of the header
- Returns
- Boolean whether the header exists or not exist
Implemented in AbstractControllerMessage.
◆ setValue()
setValue | ( | $name, | |
$value | |||
) |
Set a value.
- Parameters
-
$name The name of the variable $value The value of the variable
Implemented in AbstractControllerMessage.
◆ setValues()
setValues | ( | array | $values | ) |
Set all key value pairs at once.
- Parameters
-
$values The associative array
Implemented in AbstractControllerMessage.
◆ getValue()
getValue | ( | $name, | |
$default = null , |
|||
$validateDesc = null , |
|||
$suppressException = false |
|||
) |
Get a value.
- Parameters
-
$name The name of the variable $default The default value if the value is not defined or invalid while exceptions are suppressed (optional, default: null) $validateDesc An validation description to be used with Validator::validate() (optional, default: null) $suppressException Boolean whether to suppress a validation exception or not (optional, default: false)
- Returns
- The (filtered) value or default, if it does not exist
Implemented in AbstractControllerMessage.
◆ getBooleanValue()
getBooleanValue | ( | $name, | |
$default = false |
|||
) |
Get a value as boolean.
- Parameters
-
$name The name of the variable $default The default value if the value is not defined (default: false)
- Returns
- The value or null if it does not exist
Implemented in AbstractControllerMessage.
◆ getValues()
getValues | ( | ) |
◆ clearValue()
clearValue | ( | $name | ) |
◆ clearValues()
clearValues | ( | ) |
Remove all values.
Implemented in AbstractControllerMessage.
◆ hasValue()
hasValue | ( | $name | ) |
Check for existence of a value.
- Parameters
-
$name The name of the variable
- Returns
- Boolean whether the value exists or not exist
Implemented in AbstractControllerMessage.
◆ setProperty()
setProperty | ( | $name, | |
$value | |||
) |
Set a property.
- Parameters
-
$name The name of the property $value The value of the property
Implemented in AbstractControllerMessage.
◆ getProperty()
getProperty | ( | $name | ) |
Get a property.
- Parameters
-
$name The name of the property
- Returns
- The property value or null
Implemented in AbstractControllerMessage.
◆ addError()
addError | ( | ApplicationError | $error | ) |
Add an error to the list of errors.
- Parameters
-
$error The error.
Implemented in AbstractControllerMessage.
◆ setErrors()
setErrors | ( | array | $errors | ) |
Set all errors at once.
- Parameters
-
$errors The errors array
Implemented in AbstractControllerMessage.
◆ getErrors()
getErrors | ( | ) |
◆ clearErrors()
clearErrors | ( | ) |
Remove all errors.
Implemented in AbstractControllerMessage.
◆ hasErrors()
hasErrors | ( | ) |
Check if errors exist.
- Returns
- Boolean whether there are errors or not.
Implemented in AbstractControllerMessage.