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

LifecycleEventArgs::getEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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