Failed Conditions
Pull Request — 1.3.x (#71)
by Grégoire
02:19
created

LifecycleEventArgs   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 47
ccs 0
cts 16
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntity() 0 3 1
A __construct() 0 4 1
A getObjectManager() 0 3 1
A getObject() 0 3 1
1
<?php
2
3
namespace Doctrine\Persistence\Event;
4
5
use Doctrine\Common\EventArgs;
6
use Doctrine\Persistence\ObjectManager;
7
use function class_exists;
8
9
/**
10
 * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
11
 * of entities.
12
 */
13
class LifecycleEventArgs extends EventArgs
14
{
15
    /** @var ObjectManager */
16
    private $objectManager;
17
18
    /** @var object */
19
    private $object;
20
21
    /**
22
     * @param object $object
23
     */
24
    public function __construct($object, ObjectManager $objectManager)
25
    {
26
        $this->object        = $object;
27
        $this->objectManager = $objectManager;
28
    }
29
30
    /**
31
     * Retrieves the associated entity.
32
     *
33
     * @deprecated
34
     *
35
     * @return object
36
     */
37
    public function getEntity()
38
    {
39
        return $this->object;
40
    }
41
42
    /**
43
     * Retrieves the associated object.
44
     *
45
     * @return object
46
     */
47
    public function getObject()
48
    {
49
        return $this->object;
50
    }
51
52
    /**
53
     * Retrieves the associated ObjectManager.
54
     *
55
     * @return ObjectManager
56
     */
57
    public function getObjectManager()
58
    {
59
        return $this->objectManager;
60
    }
61
}
62
63
class_exists(\Doctrine\Common\Persistence\Event\LifecycleEventArgs::class);
64