AdminCategory::setDefault()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\ThemeBundle\Entity;
15
16
use Symfony\Component\Validator\Constraints as Assert;
17
18
class AdminCategory
19
{
20
    private int $cid;
21
22
    #[Assert\Length(min: 1, max: 255)]
23
    private string $name = '';
24
25
    #[Assert\Length(min: 1, max: 255)]
26
    private string $slug = '';
27
28
    #[Assert\AtLeastOneOf([
29
        new Assert\Blank(),
30
        new Assert\Length(min: 1, max: 255)
31
    ])]
32
    private string $description = '';
33
34
    #[Assert\AtLeastOneOf([
35
        new Assert\Blank(),
36
        new Assert\Length(min: 1, max: 50)
37
    ])]
38
    private string $icon = '';
39
40
    private int $sortOrder = 99;
41
42
    private bool $default = false;
43
44
    public function getCid(): ?int
45
    {
46
        return $this->cid;
47
    }
48
49
    public function setCid(int $cid): self
50
    {
51
        $this->cid = $cid;
52
53
        return $this;
54
    }
55
56
    public function getName(): string
57
    {
58
        return $this->name;
59
    }
60
61
    public function setName(string $name): self
62
    {
63
        $this->name = $name;
64
65
        return $this;
66
    }
67
68
    public function getSlug(): string
69
    {
70
        return $this->slug;
71
    }
72
73
    public function setSlug(string $slug): self
74
    {
75
        $this->slug = $slug;
76
77
        return $this;
78
    }
79
80
    public function getDescription(): string
81
    {
82
        return $this->description;
83
    }
84
85
    public function setDescription(string $description): self
86
    {
87
        $this->description = $description ?? '';
88
89
        return $this;
90
    }
91
92
    public function getIcon(): string
93
    {
94
        return $this->icon;
95
    }
96
97
    public function setIcon(string $icon): self
98
    {
99
        $this->icon = $icon ?? '';
100
101
        return $this;
102
    }
103
104
    public function getSortOrder(): int
105
    {
106
        return $this->sortOrder;
107
    }
108
109
    public function setSortOrder(int $sortOrder): self
110
    {
111
        $this->sortOrder = $sortOrder;
112
113
        return $this;
114
    }
115
116
    public function isDefault(): bool
117
    {
118
        return $this->default;
119
    }
120
121
    public function setDefault(bool $default): self
122
    {
123
        $this->default = $default;
124
125
        return $this;
126
    }
127
}
128