__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 5
1
<?php
2
3
namespace steevanb\DoctrineEvents\Doctrine\ORM\Event;
4
5
use Doctrine\ORM\EntityManagerInterface;
6
7
class OnCreateEntityOverrideLocalValuesEventArgs extends AbstractOnCreateEntityEventArgs
8
{
9
    const EVENT_NAME = 'onCreateEntityOverrideLocalValues';
10
11
    /** @var bool */
12
    protected $overrideLocalValues;
13
14
    /**
15
     * @param EntityManagerInterface $em
16
     * @param string $className
17
     * @param array $data
18
     * @param array $hints
19
     * @param bool $overrideLocalValues
20
     */
21
    public function __construct(
22
        EntityManagerInterface $em,
23
        $className,
24
        array $data,
25
        array $hints,
26
        $overrideLocalValues
27
    ) {
28
        parent::__construct($em, $className, $data, $hints);
29
        $this->setOverrideLocalValues($overrideLocalValues);
30
    }
31
32
    /**
33
     * @param bool $override
34
     * @return $this
35
     */
36
    public function setOverrideLocalValues($override)
37
    {
38
        $this->overrideLocalValues = boolval($override);
39
40
        return $this;
41
    }
42
43
    /** @return bool */
44
    public function getOverrideLocalValues()
45
    {
46
        return $this->overrideLocalValues;
47
    }
48
}
49