Source for file Observerable.class.php
Documentation is available at Observerable.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, Observerable
* The Observerable is responsible for sending updates to changes to it's state
* to any Observers. The Observerable contains important information to other
* objects in the program. If any changes are made, it will notify all it's
* Observers. It will define the information it passes, and the Observer is
* responsible for interpretting the data.
* @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, Observerable
gumbo_load ("Interface_Observer");
* Attaches (registers) an Observer to the Observerable
* @param Gumbo_Interface_Observer $obj
public function attach (Gumbo_Interface_Observer $obj);
* Detach (unregister) an Observer from the Observerable
* @param Gumbo_Interface_Observer $obj
public function detach (Gumbo_Interface_Observer $obj);
* Notifies the Observers about changes to the Observerable object state
* The method will send data to the Observer through the Observer update
* method. The supplied arguments will be an array, consisting
* of a key=>value pairs with data the Observerable wants to
* pass. The Observer should provide implementation to parse this
* information into the necessary values. The Observerable class should
* define the type of array data it will be outputting, allowing an
* Observer to properly parse the information.