1 | <?php |
||
32 | class PreUpdateEventArgs extends LifecycleEventArgs |
||
33 | { |
||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $entityChangeSet; |
||
38 | |||
39 | /** |
||
40 | * Constructor. |
||
41 | * |
||
42 | * @param object $entity |
||
43 | * @param EntityManagerInterface $em |
||
44 | * @param array $changeSet |
||
45 | */ |
||
46 | public function __construct($entity, EntityManagerInterface $em, array &$changeSet) |
||
52 | |||
53 | /** |
||
54 | * Retrieves entity changeset. |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public function getEntityChangeSet() |
||
62 | |||
63 | /** |
||
64 | * Checks if field has a changeset. |
||
65 | * |
||
66 | * @param string $field |
||
67 | * |
||
68 | * @return boolean |
||
69 | */ |
||
70 | public function hasChangedField($field) |
||
74 | |||
75 | /** |
||
76 | * Gets the old value of the changeset of the changed field. |
||
77 | * |
||
78 | * @param string $field |
||
79 | * |
||
80 | * @return mixed |
||
81 | */ |
||
82 | public function getOldValue($field) |
||
88 | |||
89 | /** |
||
90 | * Gets the new value of the changeset of the changed field. |
||
91 | * |
||
92 | * @param string $field |
||
93 | * |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function getNewValue($field) |
||
102 | |||
103 | /** |
||
104 | * Sets the new value of this field. |
||
105 | * |
||
106 | * @param string $field |
||
107 | * @param mixed $value |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | public function setNewValue($field, $value) |
||
117 | |||
118 | /** |
||
119 | * Asserts the field exists in changeset. |
||
120 | * |
||
121 | * @param string $field |
||
122 | * |
||
123 | * @return void |
||
124 | * |
||
125 | * @throws \InvalidArgumentException |
||
126 | */ |
||
127 | private function assertValidField($field) |
||
137 | } |
||
138 |