Failed Conditions
Push — master ( 3a6c46...2fbe69 )
by Luís
36s queued 11s
created

LifecycleEventArgs   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 47
rs 10
c 0
b 0
f 0
ccs 0
cts 16
cp 0

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
8
/**
9
 * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
10
 * of entities.
11
 */
12
class LifecycleEventArgs extends EventArgs
13
{
14
    /** @var ObjectManager */
15
    private $objectManager;
16
17
    /** @var object */
18
    private $object;
19
20
    /**
21
     * @param object $object
22
     */
23
    public function __construct($object, ObjectManager $objectManager)
24
    {
25
        $this->object        = $object;
26
        $this->objectManager = $objectManager;
27
    }
28
29
    /**
30
     * Retrieves the associated entity.
31
     *
32
     * @deprecated
33
     *
34
     * @return object
35
     */
36
    public function getEntity()
37
    {
38
        return $this->object;
39
    }
40
41
    /**
42
     * Retrieves the associated object.
43
     *
44
     * @return object
45
     */
46
    public function getObject()
47
    {
48
        return $this->object;
49
    }
50
51
    /**
52
     * Retrieves the associated ObjectManager.
53
     *
54
     * @return ObjectManager
55
     */
56
    public function getObjectManager()
57
    {
58
        return $this->objectManager;
59
    }
60
}
61