Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / PluginObserver.class.php
blob520d62a4d345932cb8aa0377a5d49a7442fbfeaa
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * The PluginObserver class is used alongside PluginManager to implement
5 * the Observer Design Pattern.
7 * @package PhpMyAdmin
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 /* Each PluginObserver instance contains a PluginManager instance */
14 require_once 'PluginManager.class.php';
16 /**
17 * This class implements the SplObserver interface
19 * @package PhpMyAdmin
20 * @link http://php.net/manual/en/class.splobserver.php
22 abstract class PluginObserver implements SplObserver
24 /**
25 * PluginManager instance that contains a list with all the observer
26 * plugins that attach to it
28 * @var type PluginManager
30 private $_pluginManager;
32 /**
33 * Constructor
35 * @param PluginManager $pluginManager The Plugin Manager instance
37 public function __construct($pluginManager)
39 $this->_pluginManager = $pluginManager;
42 /**
43 * This method is called when any PluginManager to which the observer
44 * is attached calls PluginManager::notify()
46 * TODO Declare this function abstract, removing its body,
47 * as soon as we drop support for PHP 5.2.x.
48 * See bug #3538655.
50 * @param SplSubject $subject The PluginManager notifying the observer
51 * of an update.
53 * @return void
55 public function update (SplSubject $subject)
57 throw new Exception(
58 'PluginObserver::update must be overridden in child classes.'
63 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
66 /**
67 * Gets the PluginManager instance that contains the list with all the
68 * plugins that attached to it
70 * @return type PluginManager
72 public function getPluginManager()
74 return $this->_pluginManager;
77 /**
78 * Setter for $_pluginManager
80 * @param PluginManager $_pluginManager the private instance that it will
81 * attach to
83 * @return void
85 public function setPluginManager($_pluginManager)
87 $this->_pluginManager = $_pluginManager;