ControllerMessage Interface Reference

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.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 23 of file ControllerMessage.php.

+ Inheritance diagram for ControllerMessage:

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
$senderThe 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
$contextThe 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
$actionThe name of the action

Implemented in AbstractControllerMessage.

◆ getAction()

getAction ( )

Get the name of the action.

Returns
The name of the action

Implemented in AbstractControllerMessage.

◆ setFormat()

setFormat (   $format)

Set the message format.

Parameters
$formatA 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
$nameThe header name
$valueThe header value

Implemented in AbstractControllerMessage.

◆ setHeaders()

setHeaders ( array  $headers)

Set all headers at once.

Parameters
$headersThe associative array

Implemented in AbstractControllerMessage.

◆ getHeader()

getHeader (   $name,
  $default = null 
)

Get a header value.

Parameters
$nameThe header name
$defaultThe 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 ( )

Get all key headers.

Returns
An associative array

Implemented in AbstractControllerMessage.

◆ clearHeader()

clearHeader (   $name)

Remove a header.

Parameters
$nameThe name of the header

Implemented in AbstractControllerMessage.

◆ clearHeaders()

clearHeaders ( )

Remove all headers.

Implemented in AbstractControllerMessage.

◆ hasHeader()

hasHeader (   $name)

Check for existence of a header.

Parameters
$nameThe name of the header
Returns
Boolean whether the header exists or not exist

Implemented in AbstractControllerMessage.

◆ setValue()

setValue (   $name,
  $value 
)

Set a value.

Parameters
$nameThe name of the variable
$valueThe value of the variable

Implemented in AbstractControllerMessage.

◆ setValues()

setValues ( array  $values)

Set all key value pairs at once.

Parameters
$valuesThe associative array

Implemented in AbstractControllerMessage.

◆ getValue()

getValue (   $name,
  $default = null,
  $validateDesc = null,
  $suppressException = false 
)

Get a value.

Parameters
$nameThe name of the variable
$defaultThe default value if the value is not defined or invalid while exceptions are suppressed (optional, default: null)
$validateDescAn validation description to be used with Validator::validate() (optional, default: null)
$suppressExceptionBoolean 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
$nameThe name of the variable
$defaultThe 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 ( )

Get all key value pairs.

Returns
An associative array

Implemented in AbstractControllerMessage.

◆ clearValue()

clearValue (   $name)

Remove a value.

Parameters
$nameThe name of the variable

Implemented in AbstractControllerMessage.

◆ clearValues()

clearValues ( )

Remove all values.

Implemented in AbstractControllerMessage.

◆ hasValue()

hasValue (   $name)

Check for existence of a value.

Parameters
$nameThe name of the variable
Returns
Boolean whether the value exists or not exist

Implemented in AbstractControllerMessage.

◆ setProperty()

setProperty (   $name,
  $value 
)

Set a property.

Parameters
$nameThe name of the property
$valueThe value of the property

Implemented in AbstractControllerMessage.

◆ getProperty()

getProperty (   $name)

Get a property.

Parameters
$nameThe 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
$errorThe error.

Implemented in AbstractControllerMessage.

◆ setErrors()

setErrors ( array  $errors)

Set all errors at once.

Parameters
$errorsThe errors array

Implemented in AbstractControllerMessage.

◆ getErrors()

getErrors ( )

Get all errors.

Returns
An array of Error instances.

Implemented in AbstractControllerMessage.

◆ 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.