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

Class: IObserver

Source Location: /org/puremvc/php/multicore/interfaces/IObserver.php

Interface Overview


The interface definition for a PureMVC Observer.


Author(s):

Methods



Class Details

[line 60]
The interface definition for a PureMVC Observer.

In PureMVC, IObserver implementors assume these responsibilities:

  • Encapsulate the notification (callback) method of the interested object.
  • Encapsulate the notification context (this) of the interested object.
  • Provide methods for setting the interested object' notification method and context.
  • Provide a method for notifying the interested object.
PureMVC does not rely upon underlying event models and PHP does not have an inherent event model.

The Observer Pattern as implemented within PureMVC exists to support event driven communication between the application and the actors of the MVC triad.

An Observer is an object that encapsulates information about an interested object with a notification method that should be called when an </b>INotification</b> is broadcast. The Observer then acts as a proxy for notifying the interested object.

Observers can receive Notifications by having their notifyObserver method invoked, passing in an object implementing the INotification interface, such as a subclass of Notification.




Tags:

see:  INotification
see:  IView


[ Top ]


Class Methods


method compareNotifyContext [line 94]

bool compareNotifyContext( object $object)

Compare the given object to the notificaiton context object.



Tags:

return:  Boolean indicating if the notification context and the object are the same.
access:  public


Parameters:

object   $object   the object to compare.

[ Top ]

method notifyObserver [line 86]

void notifyObserver( INotification $notification)

Notify the interested object.



Tags:

access:  public


Parameters:

INotification   $notification   the INotification to pass to the interested object's notification method

[ Top ]

method setNotifyContext [line 78]

void setNotifyContext( mixed $notifyContext)

Set the notification context.



Tags:

access:  public


Parameters:

mixed   $notifyContext   The notification context ($this) of the interested object.

[ Top ]

method setNotifyMethod [line 70]

void setNotifyMethod( string $notifyMethod)

Set the notification method.

The notification method should take one parameter of type INotification.




Tags:

access:  public


Parameters:

string   $notifyMethod   The notification (callback) method name of the interested object.

[ Top ]


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