Events::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\SkeletonMapper;
6
7
/**
8
 * @codeCoverageIgnore
9
 */
10
final class Events
11
{
12
    /**
13
     * Private constructor. This class is not meant to be instantiated.
14
     */
15
    private function __construct()
16
    {
17
    }
18
19
    /**
20
     * The preRemove event occurs for a given object before the respective
21
     * ObjectManager remove operation for that object is executed.
22
     *
23
     * This is a object lifecycle event.
24
     */
25
    public const preRemove = 'preRemove';
26
27
    /**
28
     * The postRemove event occurs for a object after the object has
29
     * been deleted. It will be invoked after the database delete operations.
30
     *
31
     * This is a object lifecycle event.
32
     */
33
    public const postRemove = 'postRemove';
34
35
    /**
36
     * The prePersist event occurs for a given object before the respective
37
     * ObjectManager persist operation for that object is executed.
38
     *
39
     * This is a object lifecycle event.
40
     */
41
    public const prePersist = 'prePersist';
42
43
    /**
44
     * The postPersist event occurs for a object after the object has
45
     * been made persistent.
46
     *
47
     * This is a object lifecycle event.
48
     */
49
    public const postPersist = 'postPersist';
50
51
    /**
52
     * The preUpdate event occurs before the database update operations to
53
     * object data.
54
     *
55
     * This is a object lifecycle event.
56
     */
57
    public const preUpdate = 'preUpdate';
58
59
    /**
60
     * The postUpdate event occurs after the database update operations to
61
     * object data.
62
     *
63
     * This is a object lifecycle event.
64
     */
65
    public const postUpdate = 'postUpdate';
66
67
    /**
68
     * The preLoad event occurs for a object before the object has been loaded
69
     * into the current ObjectManager from the database or before the refresh operation
70
     * has been applied to it.
71
     *
72
     * This is a object lifecycle event.
73
     */
74
    public const preLoad = 'preLoad';
75
76
    /**
77
     * The postLoad event occurs for a object after the object has been loaded
78
     * into the current ObjectManager from the database or after the refresh operation
79
     * has been applied to it.
80
     *
81
     * This is a object lifecycle event.
82
     */
83
    public const postLoad = 'postLoad';
84
85
    /**
86
     * The preFlush event occurs when the ObjectManager#flush() operation is invoked.
87
     * This event is always raised right after ObjectManager#flush() call.
88
     */
89
    public const preFlush = 'preFlush';
90
91
    /**
92
     * The onFlush event occurs when the ObjectManager#flush() operation is invoked
93
     * but before any actual database operations are executed. The event is only raised if there is
94
     * actually something to do for the underlying UnitOfWork. If nothing needs to be done,
95
     * the onFlush event is not raised.
96
     */
97
    public const onFlush = 'onFlush';
98
99
    /**
100
     * The postFlush event occurs when the ObjectManager#flush() operation is invoked and
101
     * after all actual database operations are executed successfully. The event is only raised if there is
102
     * actually something to do for the underlying UnitOfWork. If nothing needs to be done,
103
     * the postFlush event is not raised. The event won't be raised if an error occurs during the
104
     * flush operation.
105
     */
106
    public const postFlush = 'postFlush';
107
108
    /**
109
     * The onClear event occurs when the ObjectManager#clear() operation is invoked,
110
     * after all references to objects have been removed from the unit of work.
111
     */
112
    public const onClear = 'onClear';
113
}
114