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