|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Doctrine\ORM; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Container for all ORM events. |
|
9
|
|
|
* |
|
10
|
|
|
* This class cannot be instantiated. |
|
11
|
|
|
*/ |
|
12
|
|
|
final class Events |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* Private constructor. This class is not meant to be instantiated. |
|
16
|
|
|
*/ |
|
17
|
|
|
private function __construct() |
|
18
|
|
|
{ |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* The preRemove event occurs for a given entity before the respective |
|
23
|
|
|
* EntityManager remove operation for that entity is executed. |
|
24
|
|
|
* |
|
25
|
|
|
* This is an entity lifecycle event. |
|
26
|
|
|
* |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
public const preRemove = 'preRemove'; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* The postRemove event occurs for an entity after the entity has |
|
33
|
|
|
* been deleted. It will be invoked after the database delete operations. |
|
34
|
|
|
* |
|
35
|
|
|
* This is an entity lifecycle event. |
|
36
|
|
|
* |
|
37
|
|
|
* @var string |
|
38
|
|
|
*/ |
|
39
|
|
|
public const postRemove = 'postRemove'; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* The prePersist event occurs for a given entity before the respective |
|
43
|
|
|
* EntityManager persist operation for that entity is executed. |
|
44
|
|
|
* |
|
45
|
|
|
* This is an entity lifecycle event. |
|
46
|
|
|
* |
|
47
|
|
|
* @var string |
|
48
|
|
|
*/ |
|
49
|
|
|
public const prePersist = 'prePersist'; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* The postPersist event occurs for an entity after the entity has |
|
53
|
|
|
* been made persistent. It will be invoked after the database insert operations. |
|
54
|
|
|
* Generated primary key values are available in the postPersist event. |
|
55
|
|
|
* |
|
56
|
|
|
* This is an entity lifecycle event. |
|
57
|
|
|
* |
|
58
|
|
|
* @var string |
|
59
|
|
|
*/ |
|
60
|
|
|
public const postPersist = 'postPersist'; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* The preUpdate event occurs before the database update operations to |
|
64
|
|
|
* entity data. |
|
65
|
|
|
* |
|
66
|
|
|
* This is an entity lifecycle event. |
|
67
|
|
|
* |
|
68
|
|
|
* @var string |
|
69
|
|
|
*/ |
|
70
|
|
|
public const preUpdate = 'preUpdate'; |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* The postUpdate event occurs after the database update operations to |
|
74
|
|
|
* entity data. |
|
75
|
|
|
* |
|
76
|
|
|
* This is an entity lifecycle event. |
|
77
|
|
|
* |
|
78
|
|
|
* @var string |
|
79
|
|
|
*/ |
|
80
|
|
|
public const postUpdate = 'postUpdate'; |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* The postLoad event occurs for an entity after the entity has been loaded |
|
84
|
|
|
* into the current EntityManager from the database or after the refresh operation |
|
85
|
|
|
* has been applied to it. |
|
86
|
|
|
* |
|
87
|
|
|
* Note that the postLoad event occurs for an entity before any associations have been |
|
88
|
|
|
* initialized. Therefore it is not safe to access associations in a postLoad callback |
|
89
|
|
|
* or event handler. |
|
90
|
|
|
* |
|
91
|
|
|
* This is an entity lifecycle event. |
|
92
|
|
|
* |
|
93
|
|
|
* @var string |
|
94
|
|
|
*/ |
|
95
|
|
|
public const postLoad = 'postLoad'; |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* The loadClassMetadata event occurs after the mapping metadata for a class |
|
99
|
|
|
* has been loaded from a mapping source (annotations/xml). |
|
100
|
|
|
* |
|
101
|
|
|
* @var string |
|
102
|
|
|
*/ |
|
103
|
|
|
public const loadClassMetadata = 'loadClassMetadata'; |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* The onClassMetadataNotFound event occurs whenever loading metadata for a class |
|
107
|
|
|
* failed. |
|
108
|
|
|
* |
|
109
|
|
|
* @var string |
|
110
|
|
|
*/ |
|
111
|
|
|
public const onClassMetadataNotFound = 'onClassMetadataNotFound'; |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* The preFlush event occurs when the EntityManager#flush() operation is invoked, |
|
115
|
|
|
* but before any changes to managed entities have been calculated. This event is |
|
116
|
|
|
* always raised right after EntityManager#flush() call. |
|
117
|
|
|
*/ |
|
118
|
|
|
public const preFlush = 'preFlush'; |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* The onFlush event occurs when the EntityManager#flush() operation is invoked, |
|
122
|
|
|
* after any changes to managed entities have been determined but before any |
|
123
|
|
|
* actual database operations are executed. The event is only raised if there is |
|
124
|
|
|
* actually something to do for the underlying UnitOfWork. If nothing needs to be done, |
|
125
|
|
|
* the onFlush event is not raised. |
|
126
|
|
|
* |
|
127
|
|
|
* @var string |
|
128
|
|
|
*/ |
|
129
|
|
|
public const onFlush = 'onFlush'; |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* The postFlush event occurs when the EntityManager#flush() operation is invoked and |
|
133
|
|
|
* after all actual database operations are executed successfully. The event is only raised if there is |
|
134
|
|
|
* actually something to do for the underlying UnitOfWork. If nothing needs to be done, |
|
135
|
|
|
* the postFlush event is not raised. The event won't be raised if an error occurs during the |
|
136
|
|
|
* flush operation. |
|
137
|
|
|
* |
|
138
|
|
|
* @var string |
|
139
|
|
|
*/ |
|
140
|
|
|
public const postFlush = 'postFlush'; |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* The onClear event occurs when the EntityManager#clear() operation is invoked, |
|
144
|
|
|
* after all references to entities have been removed from the unit of work. |
|
145
|
|
|
* |
|
146
|
|
|
* @var string |
|
147
|
|
|
*/ |
|
148
|
|
|
public const onClear = 'onClear'; |
|
149
|
|
|
} |
|
150
|
|
|
|