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, $filter=null, $options=null)
 
 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 (   $sender)

Set the name of the sending Controller.

Parameters
$senderThe name of the Controller

Implemented in AbstractControllerMessage.

getSender ( )

Get the name of the sending Controller.

Returns
The name of the Controller

Implemented in AbstractControllerMessage.

setContext (   $context)

Set the name of the context.

Parameters
$contextThe name of the context

Implemented in AbstractControllerMessage.

getContext ( )

Get the name of the context.

Returns
The name of the context

Implemented in AbstractControllerMessage.

setAction (   $action)

Set the name of the action.

Parameters
$actionThe name of the action

Implemented in AbstractControllerMessage.

getAction ( )

Get the name of the action.

Returns
The name of the action

Implemented in AbstractControllerMessage.

setFormat (   $format)

Set the message format.

Parameters
$formatA key of the configuration section 'Formats'

Implemented in AbstractControllerMessage.

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 (   $name,
  $value 
)

Set a header value.

Parameters
$nameThe header name
$valueThe header value

Implemented in AbstractControllerMessage.

setHeaders ( array  $headers)

Set all headers at once.

Parameters
$headersThe associative array

Implemented in AbstractControllerMessage.

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 ( )

Get all key headers.

Returns
An associative array

Implemented in AbstractControllerMessage.

clearHeader (   $name)

Remove a header.

Parameters
$nameThe name of the header

Implemented in AbstractControllerMessage.

clearHeaders ( )

Remove all headers.

Implemented in AbstractControllerMessage.

hasHeader (   $name)

Check for existance of a header.

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

Implemented in AbstractControllerMessage.

setValue (   $name,
  $value 
)

Set a value.

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

Implemented in AbstractControllerMessage.

setValues ( array  $values)

Set all key value pairs at once.

Parameters
$valuesThe associative array

Implemented in AbstractControllerMessage.

getValue (   $name,
  $default = null,
  $filter = null,
  $options = null 
)

Get a value.

Parameters
$nameThe name of the variable
$defaultThe default value if the value is not defined (optional, default: null)
$filterPHP filter constant (FILTER_SANITIZE/FILTER_VALIDATE) to be applied to the value (optional, default: null)
$optionsFilter parameters (optional, default: null)
Returns
The (filtered) value or default, if it does not exist

Implemented in AbstractControllerMessage.

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 ( )

Get all key value pairs.

Returns
An associative array

Implemented in AbstractControllerMessage.

clearValue (   $name)

Remove a value.

Parameters
$nameThe name of the variable

Implemented in AbstractControllerMessage.

clearValues ( )

Remove all values.

Implemented in AbstractControllerMessage.

hasValue (   $name)

Check for existance of a value.

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

Implemented in AbstractControllerMessage.

setProperty (   $name,
  $value 
)

Set a property.

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

Implemented in AbstractControllerMessage.

getProperty (   $name)

Get a property.

Parameters
$nameThe name of the property
Returns
The property value or null

Implemented in AbstractControllerMessage.

addError ( ApplicationError  $error)

Add an error to the list of errors.

Parameters
$errorThe error.

Implemented in AbstractControllerMessage.

setErrors ( array  $errors)

Set all errors at once.

Parameters
$errorsThe errors array

Implemented in AbstractControllerMessage.

getErrors ( )

Get all errors.

Returns
An array of Error instances.

Implemented in AbstractControllerMessage.

clearErrors ( )

Remove all errors.

Implemented in AbstractControllerMessage.

hasErrors ( )

Check if errors exist.

Returns
Boolean whether there are errors or not.

Implemented in AbstractControllerMessage.