Failed Conditions
Pull Request — 2.6 (#7180)
by Ben
11:16
created

Events   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 137
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 137
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Doctrine\ORM;
21
22
/**
23
 * Container for all ORM events.
24
 *
25
 * This class cannot be instantiated.
26
 *
27
 * @author Roman Borschel <[email protected]>
28
 * @since 2.0
29
 */
30
final class Events
31
{
32
    /**
33
     * Private constructor. This class is not meant to be instantiated.
34
     */
35
    private function __construct()
36
    {
37
    }
38
39
    /**
40
     * The preRemove event occurs for a given entity before the respective
41
     * EntityManager remove operation for that entity is executed.
42
     *
43
     * This is an entity lifecycle event.
44
     *
45
     * @var string
46
     */
47
    const preRemove = 'preRemove';
48
49
    /**
50
     * The postRemove event occurs for an entity after the entity has
51
     * been deleted. It will be invoked after the database delete operations.
52
     *
53
     * This is an entity lifecycle event.
54
     *
55
     * @var string
56
     */
57
    const postRemove = 'postRemove';
58
59
    /**
60
     * The prePersist event occurs for a given entity before the respective
61
     * EntityManager persist operation for that entity is executed.
62
     *
63
     * This is an entity lifecycle event.
64
     *
65
     * @var string
66
     */
67
    const prePersist = 'prePersist';
68
69
    /**
70
     * The postPersist event occurs for an entity after the entity has
71
     * been made persistent. It will be invoked after the database insert operations.
72
     * Generated primary key values are available in the postPersist event.
73
     *
74
     * This is an entity lifecycle event.
75
     *
76
     * @var string
77
     */
78
    const postPersist = 'postPersist';
79
80
    /**
81
     * The preUpdate event occurs before the database update operations to
82
     * entity data.
83
     *
84
     * This is an entity lifecycle event.
85
     *
86
     * @var string
87
     */
88
    const preUpdate = 'preUpdate';
89
90
    /**
91
     * The postUpdate event occurs after the database update operations to
92
     * entity data.
93
     *
94
     * This is an entity lifecycle event.
95
     *
96
     * @var string
97
     */
98
    const postUpdate = 'postUpdate';
99
100
    /**
101
     * The postLoad event occurs for an entity after the entity has been loaded
102
     * into the current EntityManager from the database or after the refresh operation
103
     * has been applied to it.
104
     *
105
     * Note that the postLoad event occurs for an entity before any associations have been
106
     * initialized. Therefore it is not safe to access associations in a postLoad callback
107
     * or event handler.
108
     *
109
     * This is an entity lifecycle event.
110
     *
111
     * @var string
112
     */
113
    const postLoad = 'postLoad';
114
115
    /**
116
     * The loadClassMetadata event occurs after the mapping metadata for a class
117
     * has been loaded from a mapping source (annotations/xml/yaml).
118
     *
119
     * @var string
120
     */
121
    const loadClassMetadata = 'loadClassMetadata';
122
123
    /**
124
     * The onClassMetadataNotFound event occurs whenever loading metadata for a class
125
     * failed.
126
     *
127
     * @var string
128
     */
129
    const onClassMetadataNotFound = 'onClassMetadataNotFound';
130
131
    /**
132
     * The preFlush event occurs when the EntityManager#flush() operation is invoked,
133
     * but before any changes to managed entities have been calculated. This event is
134
     * always raised right after EntityManager#flush() call.
135
     */
136
    const preFlush = 'preFlush';
137
138
    /**
139
     * The onFlush event occurs when the EntityManager#flush() operation is invoked,
140
     * after any changes to managed entities have been determined but before any
141
     * actual database operations are executed. The event is only raised if there is
142
     * actually something to do for the underlying UnitOfWork. If nothing needs to be done,
143
     * the onFlush event is not raised.
144
     *
145
     * @var string
146
     */
147
    const onFlush = 'onFlush';
148
149
    /**
150
     * The postFlush event occurs when the EntityManager#flush() operation is invoked and
151
     * after all actual database operations are executed successfully. The event is only raised if there is
152
     * actually something to do for the underlying UnitOfWork. If nothing needs to be done,
153
     * the postFlush event is not raised. The event won't be raised if an error occurs during the
154
     * flush operation.
155
     *
156
     * @var string
157
     */
158
    const postFlush = 'postFlush';
159
160
    /**
161
     * The onClear event occurs when the EntityManager#clear() operation is invoked,
162
     * after all references to entities have been removed from the unit of work.
163
     *
164
     * @var string
165
     */
166
    const onClear = 'onClear';
167
}
168