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.
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>.
20 namespace Doctrine\ORM;
23 * Container for all ORM events.
25 * This class cannot be instantiated.
27 * @author Roman Borschel <roman@code-factory.org>
32 private function __construct() {}
34 * The preRemove event occurs for a given entity before the respective
35 * EntityManager remove operation for that entity is executed.
37 * This is an entity lifecycle event.
41 const preRemove = 'preRemove';
43 * The postRemove event occurs for an entity after the entity has
44 * been deleted. It will be invoked after the database delete operations.
46 * This is an entity lifecycle event.
50 const postRemove = 'postRemove';
52 * The prePersist event occurs for a given entity before the respective
53 * EntityManager persist operation for that entity is executed.
55 * This is an entity lifecycle event.
59 const prePersist = 'prePersist';
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.
65 * This is an entity lifecycle event.
69 const postPersist = 'postPersist';
71 * The preUpdate event occurs before the database update operations to
74 * This is an entity lifecycle event.
78 const preUpdate = 'preUpdate';
80 * The postUpdate event occurs after the database update operations to
83 * This is an entity lifecycle event.
87 const postUpdate = 'postUpdate';
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.
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
97 * This is an entity lifecycle event.
101 const postLoad = 'postLoad';
103 * The loadClassMetadata event occurs after the mapping metadata for a class
104 * has been loaded from a mapping source (annotations/xml/yaml).
108 const loadClassMetadata = 'loadClassMetadata';
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.
115 const preFlush = 'preFlush';
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.
126 const onFlush = 'onFlush';
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
137 const postFlush = 'postFlush';
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.
145 const onClear = 'onClear';