Passed
Push — main ( b87b9b...32046f )
by Axel
04:33
created

Permission::getLevel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
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\PermissionsBundle\Entity;
15
16
use Doctrine\ORM\Mapping as ORM;
17
use Symfony\Component\Validator\Constraints as Assert;
18
use Zikula\PermissionsBundle\Repository\PermissionRepository;
19
20
#[ORM\Entity(repositoryClass: PermissionRepository::class)]
21
#[ORM\Table(name: 'group_perms')]
22
class Permission
23
{
24
    #[ORM\Id]
25
    #[ORM\Column]
26
    #[ORM\GeneratedValue(strategy: 'AUTO')]
27
    private int $pid;
28
29
    #[ORM\Column]
30
    private int $gid = 0;
31
32
    #[ORM\Column]
33
    private int $sequence = 0;
34
35
    #[ORM\Column(length: 255)]
36
    #[Assert\Length(min: 1, max: 255)]
37
    private string $component = '';
38
39
    #[ORM\Column(length: 255)]
40
    #[Assert\Length(min: 1, max: 255)]
41
    private string $instance = '';
42
43
    #[ORM\Column]
44
    private int $level = 0;
45
46
    #[ORM\Column(length: 255)]
47
    #[Assert\AtLeastOneOf([
48
        new Assert\Blank(),
49
        new Assert\Length(min: 1, max: 255)
50
    ])]
51
    private string $comment = '';
52
53
    /**
54
     * optional colour (Bootstrap contextual class)
55
     */
56
    #[ORM\Column(length: 10)]
57
    #[Assert\AtLeastOneOf([
58
        new Assert\Blank(),
59
        new Assert\Length(min: 1, max: 10)
60
    ])]
61
    private string $colour = '';
62
63
    public function getPid(): ?int
64
    {
65
        return $this->pid;
66
    }
67
68
    public function setPid(int $pid): self
69
    {
70
        $this->pid = $pid;
71
72
        return $this;
73
    }
74
75
    public function getGid(): int
76
    {
77
        return $this->gid;
78
    }
79
80
    public function setGid(int $gid): self
81
    {
82
        $this->gid = $gid;
83
84
        return $this;
85
    }
86
87
    public function getSequence(): int
88
    {
89
        return $this->sequence;
90
    }
91
92
    public function setSequence(int $sequence): self
93
    {
94
        $this->sequence = $sequence;
95
96
        return $this;
97
    }
98
99
    public function getComponent(): string
100
    {
101
        return $this->component;
102
    }
103
104
    public function setComponent(string $component): self
105
    {
106
        $this->component = $component;
107
108
        return $this;
109
    }
110
111
    public function getInstance(): string
112
    {
113
        return $this->instance;
114
    }
115
116
    public function setInstance(string $instance): self
117
    {
118
        $this->instance = $instance;
119
120
        return $this;
121
    }
122
123
    public function getLevel(): int
124
    {
125
        return $this->level;
126
    }
127
128
    public function setLevel(int $level): self
129
    {
130
        $this->level = $level;
131
132
        return $this;
133
    }
134
135
    public function getComment(): string
136
    {
137
        return $this->comment;
138
    }
139
140
    public function setComment(string $comment): self
141
    {
142
        $this->comment = $comment;
143
144
        return $this;
145
    }
146
147
    public function getColour(): string
148
    {
149
        return $this->colour;
150
    }
151
152
    public function setColour(string $colour): self
153
    {
154
        $this->colour = $colour;
155
156
        return $this;
157
    }
158
}
159