Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / lib / Doctrine / ORM / Events.php
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 <roman@code-factory.org>
28  * @since 2.0
29  */
30 final class Events
31 {
32     private function __construct() {}
33     /**
34      * The preRemove event occurs for a given entity before the respective
35      * EntityManager remove operation for that entity is executed.
36      *
37      * This is an entity lifecycle event.
38      *
39      * @var string
40      */
41     const preRemove = 'preRemove';
42     /**
43      * The postRemove event occurs for an entity after the entity has
44      * been deleted. It will be invoked after the database delete operations.
45      *
46      * This is an entity lifecycle event.
47      *
48      * @var string
49      */
50     const postRemove = 'postRemove';
51     /**
52      * The prePersist event occurs for a given entity before the respective
53      * EntityManager persist operation for that entity is executed.
54      *
55      * This is an entity lifecycle event.
56      *
57      * @var string
58      */
59     const prePersist = 'prePersist';
60     /**
61      * The postPersist event occurs for an entity after the entity has
62      * been made persistent. It will be invoked after the database insert operations.
63      * Generated primary key values are available in the postPersist event.
64      *
65      * This is an entity lifecycle event.
66      *
67      * @var string
68      */
69     const postPersist = 'postPersist';
70     /**
71      * The preUpdate event occurs before the database update operations to
72      * entity data.
73      *
74      * This is an entity lifecycle event.
75      *
76      * @var string
77      */
78     const preUpdate = 'preUpdate';
79     /**
80      * The postUpdate event occurs after the database update operations to
81      * entity data.
82      *
83      * This is an entity lifecycle event.
84      *
85      * @var string
86      */
87     const postUpdate = 'postUpdate';
88     /**
89      * The postLoad event occurs for an entity after the entity has been loaded
90      * into the current EntityManager from the database or after the refresh operation
91      * has been applied to it.
92      *
93      * Note that the postLoad event occurs for an entity before any associations have been
94      * initialized. Therefore it is not safe to access associations in a postLoad callback
95      * or event handler.
96      *
97      * This is an entity lifecycle event.
98      *
99      * @var string
100      */
101     const postLoad = 'postLoad';
102     /**
103      * The loadClassMetadata event occurs after the mapping metadata for a class
104      * has been loaded from a mapping source (annotations/xml/yaml).
105      *
106      * @var string
107      */
108     const loadClassMetadata = 'loadClassMetadata';
109
110     /**
111      * The preFlush event occurs when the EntityManager#flush() operation is invoked,
112      * but before any changes to managed entites have been calculated. This event is
113      * always raised right after EntityManager#flush() call.
114      */
115     const preFlush = 'preFlush';
116
117     /**
118      * The onFlush event occurs when the EntityManager#flush() operation is invoked,
119      * after any changes to managed entities have been determined but before any
120      * actual database operations are executed. The event is only raised if there is
121      * actually something to do for the underlying UnitOfWork. If nothing needs to be done,
122      * the onFlush event is not raised.
123      *
124      * @var string
125      */
126     const onFlush = 'onFlush';
127
128     /**
129      * The postFlush event occurs when the EntityManager#flush() operation is invoked and
130      * after all actual database operations are executed successfully. The event is only raised if there is
131      * actually something to do for the underlying UnitOfWork. If nothing needs to be done,
132      * the postFlush event is not raised. The event won't be raised if an error occurs during the
133      * flush operation.
134      *
135      * @var string
136      */
137     const postFlush = 'postFlush';
138
139     /**
140      * The onClear event occurs when the EntityManager#clear() operation is invoked,
141      * after all references to entities have been removed from the unit of work.
142      *
143      * @var string
144      */
145     const onClear = 'onClear';
146 }