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

Class: Observer

Source Location: /org/puremvc/php/multicore/patterns/observer/Observer.php

Class Overview


A base
implementation.


Author(s):

Implements interfaces:

Variables

Methods



Class Details

[line 45]
A base
implementation.

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.

In PureMVC, Observer class 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.




Tags:

see:  Notification
see:  View


[ Top ]


Class Variables

$context =

[line 57]



Tags:

access:  private

Type:   mixed


[ Top ]

$notify =

[line 51]

The notification (callback) method name



Tags:

access:  private

Type:   string


[ Top ]



Class Methods


constructor __construct [line 69]

IObserver __construct( string $notifyMethod, mixed $notifyContext)

Constructor.

The notification method on the interested object should take one parameter of type INotification




Tags:

access:  public


Parameters:

string   $notifyMethod   The notification (callback) method name of the interested object.
mixed   $notifyContext   The notification context ($this) of the interested object.

[ Top ]

method compareNotifyContext [line 139]

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



Implementation of:
IObserver::compareNotifyContext()
Compare the given object to the notificaiton context object.

Parameters:

object   $object   the object to compare.

[ Top ]

method getNotifyContext [line 114]

mixed getNotifyContext( )

Get the notification context.



Tags:

return:  The notification context ($this) of the interested object.
access:  private


[ Top ]

method getNotifyMethod [line 104]

string getNotifyMethod( )

Get the notification method.



Tags:

return:  The notification (callback) method name of the interested object.
access:  private


[ Top ]

method notifyObserver [line 125]

void notifyObserver( INotification $notification)

Notify the interested object.



Tags:

access:  public



Implementation of:
IObserver::notifyObserver()
Notify the interested object.

Parameters:

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

[ Top ]

method setNotifyContext [line 94]

void setNotifyContext( mixed $notifyContext)

Set the notification context.



Tags:

access:  public



Implementation of:
IObserver::setNotifyContext()
Set the notification context.

Parameters:

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

[ Top ]

method setNotifyMethod [line 83]

void setNotifyMethod( string $notifyMethod)

Set the notification method.

The notification method should take one parameter of type INotification.




Tags:

access:  public



Implementation of:
IObserver::setNotifyMethod()
Set the notification method.

Parameters:

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

[ Top ]


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