org.puremvc.php.patterns.observer

# Class: Observer Source Location: /patterns/observer/Observer.php
### Class Overview
A base IObserver implementation. #### Author(s): Implements interfaces: IObserver | ### Methods __construct compareNotifyContext notifyObserver setNotifyContext setNotifyMethod
### Class Details [line 37] A base IObserver implementation. An Observer is an object that encapsulates information about an interested object with a method that should be called when a particular INotification is broadcast. In PureMVC, the Observer class assumes 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 notification method and context. Provide a method for notifying the interested object. #### Tags:
see: | org.puremvc.php.patterns.observer.Notification Notification
see: | org.puremvc.php.core.View View
[ Top ] ### Class Methods ### constructor __construct [line 52]
`Observer __construct( notifyMethod $notifyMethod, notifyContext $notifyContext)`
Constructor. The notification method on the interested object should take one parameter of type INotification #### Tags:
access: | public
#### Parameters:
notifyMethod | $notifyMethod | the notification method of the interested object
notifyContext | $notifyContext | the notification context of the interested object
[ Top ] ### method compareNotifyContext [line 126]
`boolean compareNotifyContext( object the $object)`
Compare an object to the notification context. #### Tags:
return: | indicating if the object and the notification context are the same
access: | public
#### Parameters:
object the | $object | object to compare
[ Top ] ### method notifyObserver [line 106]
`void notifyObserver( $notification)`
Notify the interested object. #### Tags:
access: | public
#### Parameters:
notification | $notification | the INotification to pass to the interested object's notification method.
[ Top ] ### method setNotifyContext [line 76]
`void setNotifyContext( notifyContext $notifyContext)`
Set the notification context. #### Tags:
access: | public
#### Parameters:
notifyContext | $notifyContext | the notification context (this) of the interested object.
[ Top ] ### method setNotifyMethod [line 66]
`void setNotifyMethod( notifyMethod $notifyMethod)`
Set the notification method. The notification method should take one parameter of type INotification . #### Tags:
access: | public
#### Parameters:
notifyMethod | $notifyMethod | the notification (callback) method of the interested object.
[ Top ] Documentation generated on Tue, 30 Sep 2008 08:05:46 -0700 by phpDocumentor 1.4.0