wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.ChangeListener.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: class.ChangeListener.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 
20 /**
21  * @class ChangeListener
22  * @ingroup Persistence
23  * @brief ChangeListener defines an interface for classes that want to
24  * be notified when a value of an persistent object changes.
25 
26  * @author ingo herwig <ingo@wemove.com>
27  */
29 {
30  /**
31  * Get a unique id for the listener.
32  * @return The id
33  */
34  function getId()
35  {
36  WCMFException::throwEx("getId() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
37  }
38  /**
39  * This method is called, when a named item has changed.
40  * @param object A reference to the PersistentObject that holds the item
41  * @param name The name of the item that has changed.
42  * @param type The type of the item that has changed.
43  * @param oldValue The old value of the item that has changed
44  * @param newValue The new value of the item that has changed
45  */
46  function valueChanged(&$object, $name, $type, $oldValue, $newValue)
47  {
48  WCMFException::throwEx("valueChanged() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
49  }
50  /**
51  * This method is called, when a property has changed.
52  * @param object A reference to the PersistentObject that holds the property
53  * @param name The name of the property that has changed.
54  * @param oldValue The old value of the item that has changed
55  * @param newValue The new value of the item that has changed
56  */
57  function propertyChanged(&$object, $name, $oldValue, $newValue)
58  {
59  WCMFException::throwEx("propertyChanged() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
60  }
61  /**
62  * This method is called, when the state has changed.
63  * @param object A reference to the PersistentObject that changed it's state
64  * @param oldValue The old value of the state
65  * @param newValue The new value of the state
66  */
67  function stateChanged(&$object, $oldValue, $newValue)
68  {
69  WCMFException::throwEx("stateChanged() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
70  }
71 }
72 ?>
ChangeListener defines an interface for classes that want to be notified when a value of an persisten...
valueChanged(&$object, $name, $type, $oldValue, $newValue)
throwEx($message, $file='', $line='')
propertyChanged(&$object, $name, $oldValue, $newValue)
stateChanged(&$object, $oldValue, $newValue)