Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
observer.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Legacy
4  * @subpackage Base
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Abstract observer class to implement the observer design pattern
14  *
15  * @package Joomla.Legacy
16  * @subpackage Base
17  * @since 11.1
18  * @deprecated 12.3 (Platform) & 4.0 (CMS)
19  * @codeCoverageIgnore
20  */
21 abstract class JObserver extends JObject
22 {
23  /**
24  * Event object to observe.
25  *
26  * @var object
27  * @since 11.1
28  * @deprecated 12.3
29  */
30  protected $_subject = null;
31 
32  /**
33  * Constructor
34  *
35  * @param object &$subject The object to observe.
36  *
37  * @since 11.1
38  * @deprecated 12.3
39  */
40  public function __construct(&$subject)
41  {
42  // Register the observer ($this) so we can be notified
43  $subject->attach($this);
44 
45  // Set the subject to observe
46  $this->_subject = &$subject;
47  }
48 
49  /**
50  * Method to update the state of observable objects
51  *
52  * @param array &$args An array of arguments to pass to the listener.
53  *
54  * @return mixed
55  *
56  * @since 11.1
57  * @deprecated 12.3
58  */
59  public abstract function update(&$args);
60 }