Total Complexity | 8 |
Total Lines | 90 |
Duplicated Lines | 0 % |
Coverage | 68.42% |
Changes | 0 |
1 | <?php |
||
17 | class Layout |
||
18 | { |
||
19 | /** |
||
20 | * @ORM\Id() |
||
21 | * @ORM\Column(type="string") |
||
22 | * @var string |
||
23 | */ |
||
24 | private $id; |
||
25 | |||
26 | /** |
||
27 | * @ORM\Column(type="boolean", name="is_default") |
||
28 | * @Groups({"layout"}) |
||
29 | * @var bool |
||
30 | */ |
||
31 | private $default = false; |
||
32 | |||
33 | /** |
||
34 | * @ORM\ManyToOne(targetEntity="Silverback\ApiComponentBundle\Entity\Content\Component\Navigation\NavBar\NavBar") |
||
35 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
36 | * @Groups({"layout"}) |
||
37 | * @var null|NavBar |
||
38 | */ |
||
39 | private $navBar; |
||
40 | |||
41 | /** |
||
42 | * @ORM\Column(nullable=true) |
||
43 | * @Groups({"layout"}) |
||
44 | * @var null|string |
||
45 | */ |
||
46 | private $className; |
||
47 | |||
48 | 5 | public function __construct() |
|
49 | { |
||
50 | 5 | $this->id = Uuid::uuid4()->getHex(); |
|
51 | 5 | } |
|
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getId(): string |
||
57 | { |
||
58 | return $this->id; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | 1 | public function isDefault(): bool |
|
65 | { |
||
66 | 1 | return $this->default; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * @param bool $default |
||
71 | */ |
||
72 | 3 | public function setDefault(bool $default): void |
|
73 | { |
||
74 | 3 | $this->default = $default; |
|
75 | 3 | } |
|
76 | |||
77 | /** |
||
78 | * @return null|NavBar |
||
79 | */ |
||
80 | 1 | public function getNavBar(): ?NavBar |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * @param null|NavBar $navBar |
||
87 | */ |
||
88 | 1 | public function setNavBar(?NavBar $navBar): void |
|
89 | { |
||
90 | 1 | $this->navBar = $navBar; |
|
91 | 1 | } |
|
92 | |||
93 | /** |
||
94 | * @return null|string |
||
95 | */ |
||
96 | public function getClassName(): ?string |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * @param null|string $className |
||
103 | */ |
||
104 | public function setClassName(?string $className): void |
||
107 | } |
||
108 | } |
||
109 |