PersistenceEvent.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\persistence;
12 
15 
16 /**
17  * PersistentEvent signals create/update/delete operations
18  * on a persistent entity.
19  *
20  * @author ingo herwig <ingo@wemove.com>
21  */
22 class PersistenceEvent extends Event {
23 
24  const NAME = __CLASS__;
25 
26  private $_object = null;
27  private $_action = null;
28 
29  /**
30  * Constructor.
31  * @param $object A reference to the involved PersistentObject instance.
32  * @param $action One of the PersistenceAction values.
33  */
34  public function __construct(PersistentObject $object, $action) {
35  $this->_object = $object;
36  $this->_action = $action;
37  }
38 
39  /**
40  * Get the object involved.
41  * @return PersistentObject instance
42  */
43  public function getObject() {
44  return $this->_object;
45  }
46 
47  /**
48  * Get the action.
49  * @return PersistenceAction value
50  */
51  public function getAction() {
52  return $this->_action;
53  }
54 }
55 ?>
Persistence layer related interfaces and classes.
Definition: namespaces.php:42
getObject()
Get the object involved.
PersistentEvent signals create/update/delete operations on a persistent entity.
Event is the base class for all events.
Definition: Event.php:18
__construct(PersistentObject $object, $action)
Constructor.
PersistentObject defines the interface of all persistent objects.