Completed
Push — profiles-entity ( 44ff50...635457 )
by jelmer
21:26 queued 14:01
created

LocationSetting::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Backend\Modules\Location\Domain\LocationSetting;
4
5
use Backend\Modules\Location\Domain\Location\Location;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Table(name="location_settings")
10
 * @ORM\Entity(repositoryClass="Backend\Modules\Location\Domain\LocationSetting\LocationSettingRepository")
11
 */
12
class LocationSetting
13
{
14
    /**
15
     * @var Location
16
     *
17
     * @ORM\Id
18
     * @ORM\ManyToOne(targetEntity="Backend\Modules\Location\Domain\Location\Location", inversedBy="settings")
19
     */
20
    private $location;
21
22
    /**
23
     * @var string
24
     *
25
     * @ORM\Id
26
     * @ORM\Column(type="string", length=180)
27
     */
28
    private $name;
29
30
    /**
31
     * @var mixed
32
     *
33
     * @ORM\Column(type="object")
34
     */
35
    private $value;
36
37 1
    public function __construct(Location $location, string $name, $value)
38
    {
39 1
        $this->location = $location;
40 1
        $this->name = $name;
41 1
        $this->value = $value;
42 1
    }
43
44 4
    public function getName(): string
45
    {
46 4
        return $this->name;
47
    }
48
49 4
    public function getValue()
50
    {
51 4
        return $this->value;
52
    }
53
54 1
    public function update($value): void
55
    {
56 1
        $this->value = $value;
57 1
    }
58
}
59