MappedProperty::getMap()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LAG\AdminBundle\Metadata\Property;
6
7
class MappedProperty extends AbstractProperty
8
{
9
    public function __construct(
10
        string $name,
11
        ?string $propertyPath,
12
        ?string $label = null,
13
        ?string $template = '@LAGAdmin/grid/properties/mapped.html.twig',
14
        bool $mapped = true,
15
        bool $sortable = true,
16
        bool $translation = false,
17
        ?string $translationDomain = 'admin',
18
        array $attr = [],
19
        array $headerAttr = [],
20
        private array $map = [],
21
    ) {
22
        parent::__construct(
23
            $name,
24
            $propertyPath,
25
            $label,
26
            $template,
27
            $mapped,
28
            $sortable,
29
            $translation,
30
            $translationDomain,
31
            $attr,
32
            $headerAttr,
33
        );
34
    }
35
36
    public function getMap(): array
37
    {
38
        return $this->map;
39
    }
40
41
    public function withMap(array $map): self
42
    {
43
        $self = clone $this;
44
        $self->map = $map;
45
46
        return $self;
47
    }
48
}
49