org-puremvc-php-multicore
[ class tree: org-puremvc-php-multicore ] [ index: org-puremvc-php-multicore ] [ all elements ]

Class: Mediator

Source Location: /org/puremvc/php/multicore/patterns/mediator/Mediator.php

Class Overview

Notifier
   |
   --Mediator

A base IMediator implementation.


Author(s):

Implements interfaces:

Variables

Constants

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: Notifier

Notifier::__construct()
Notifier::facade()
Return the Multiton Facade instance
Notifier::initializeNotifier()
Initialize this INotifier instance.
Notifier::sendNotification()
Send a INotification.

Class Details

[line 59]
A base IMediator implementation.

In PureMVC, IMediator implementors assume these responsibilities:

  • Implement a common method which returns a list of all INotifications the IMediator has interest in.
  • Implement a notification callback method.
  • Implement methods that are called when the IMediator is registered or removed from the View.
Additionally, IMediators typically:

  • Act as an intermediary between one or more view components such as text boxes or list controls, maintaining references and coordinating their behavior.
  • This is often the place where event listeners are added to view components, and their handlers implemented.
  • Respond to and generate INotifications, interacting with of the rest of the PureMVC app.
When an IMediator is registered with the IView, the IView will call the IMediator's listNotificationInterests method. The IMediator will return an Array of INotification names which it wishes to be notified about.

The IView will then create an Observer object encapsulating that IMediator's (handleNotification) method and register it as an Observer for each INotification name returned by listNotificationInterests.




Tags:

see:  View


[ Top ]


Class Variables

$mediatorName =

[line 75]

the mediator name



Tags:

access:  protected

Type:   string


[ Top ]

$viewComponent =

[line 81]

The view component



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 86]

Mediator __construct( [ $mediatorName = ""], [ $viewComponent = null])

Constructor.



Tags:

access:  public


Overrides Notifier::__construct() (parent method not documented)

Parameters:

   $mediatorName  
   $viewComponent  

[ Top ]

method getMediatorName [line 99]

string getMediatorName( )

Get Mediator Name

Get the IMediator instance name




Tags:

return:  The IMediator instance name.
access:  public



Implementation of:
IMediator::getMediatorName()
Get Mediator Name
[ Top ]

method getViewComponent [line 111]

mixed getViewComponent( )

Get View Component

Get the IMediator's view component.




Tags:

return:  The view component
access:  public



Implementation of:
IMediator::getViewComponent()
Get View Component
[ Top ]

method handleNotification [line 149]

void handleNotification( INotification $notification)

Handle Notification

Handle an INotification.




Tags:

access:  public



Implementation of:
IMediator::handleNotification()
Handle Notification

Parameters:

INotification   $notification   The INotification to be handled.

[ Top ]

method listNotificationInterests [line 136]

array listNotificationInterests( )

List Notifications Interests.

List INotification interests.




Tags:

return:  An Array of the INotification names this IMediator has an interest in.
access:  public



Implementation of:
IMediator::listNotificationInterests()
List Notifications Interests.
[ Top ]

method onRegister [line 160]

void onRegister( )

onRegister event

Called by the View when the Mediator is registered.




Tags:

access:  public



Implementation of:
IMediator::onRegister()
onRegister event
[ Top ]

method onRemove [line 171]

void; onRemove( )

onRemove event

Called by the View when the Mediator is removed.




Tags:

access:  public



Implementation of:
IMediator::onRemove()
onRemove event
[ Top ]

method setViewComponent [line 124]

void setViewComponent( mixed $viewComponent)

Set View Component

Set the IMediator's view component.




Tags:

access:  public



Implementation of:
IMediator::setViewComponent()
Set View Component

Parameters:

mixed   $viewComponent   The view component.

[ Top ]


Class Constants

NAME =  'Mediator'

[line 69]

The default name of the Mediator.

Typically, a Mediator will be written to serve one specific control or group controls and so, will not have a need to be dynamically named.



[ Top ]



Documentation generated on Mon, 03 Aug 2009 04:57:59 +0000 by phpDocumentor 1.4.2