Source for file Observer.class.php
Documentation is available at Observer.class.php
* Gumbo Library Framework
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* Observer Pattern Interface, Observer
* An Observer is simply an object that wants to receive constant updates
* to the changes of another object (Observerable). The Observer constructor
* should register with the Observerable. The Observer should also define
* a destructor method (__destruct) to remove itself from any Observerable
* objects it registered with.
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* @desc Observer Pattern Interface, Observer
* Receives updated information from an Observerable object
* The Observerable will send changes to the Observer through this method. The
* data is a key=>val array, containing important information about the
* Observerable. Each Observer will be required to parse the array for the
* correct details. For example, if an Observerable send out updates on it's
* current status ($data['status'] = value), the Observer should look for
* foreach ($data as $key=>$val) {
* if ($key == "status") {
* // do something with the value
* The key=>value approach was used because a single Observer can be registered
* with multiple Observerable objects.
* @param array $data key=>val array with important data for the Observer
public function update ($data);