1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Entity; |
8
|
|
|
|
9
|
|
|
use Chamilo\CoreBundle\Repository\RoleRepository; |
10
|
|
|
use DateTime; |
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
12
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
13
|
|
|
|
14
|
|
|
#[ORM\Entity(repositoryClass: RoleRepository::class)] |
15
|
|
|
#[ORM\Table(name: 'role')] |
16
|
|
|
class Role |
17
|
|
|
{ |
18
|
|
|
#[ORM\Id] |
19
|
|
|
#[ORM\GeneratedValue(strategy: 'AUTO')] |
20
|
|
|
#[ORM\Column(type: 'integer', options: ['unsigned' => true])] |
21
|
|
|
private ?int $id = null; |
22
|
|
|
|
23
|
|
|
#[Assert\NotBlank] |
24
|
|
|
#[ORM\Column(type: 'string', length: 50, unique: true)] |
25
|
|
|
private string $code; |
26
|
|
|
|
27
|
|
|
#[ORM\Column(type: 'integer')] |
28
|
|
|
private int $constantValue; |
29
|
|
|
|
30
|
|
|
#[Assert\NotBlank] |
31
|
|
|
#[ORM\Column(type: 'string', length: 255)] |
32
|
|
|
private string $title; |
33
|
|
|
|
34
|
|
|
#[ORM\Column(type: 'text', nullable: true)] |
35
|
|
|
private ?string $description = null; |
36
|
|
|
|
37
|
|
|
#[ORM\Column(type: 'boolean')] |
38
|
|
|
private bool $systemRole = false; |
39
|
|
|
|
40
|
|
|
#[ORM\Column(type: 'datetime', nullable: true)] |
41
|
|
|
private ?DateTime $createdAt = null; |
42
|
|
|
|
43
|
|
|
#[ORM\Column(type: 'integer', nullable: true, options: ['unsigned' => true])] |
44
|
|
|
private ?int $createdBy = null; |
45
|
|
|
|
46
|
|
|
#[ORM\Column(type: 'datetime', nullable: true)] |
47
|
|
|
private ?DateTime $updatedAt = null; |
48
|
|
|
|
49
|
|
|
#[ORM\Column(type: 'integer', nullable: true, options: ['unsigned' => true])] |
50
|
|
|
private ?int $updatedBy = null; |
51
|
|
|
|
52
|
|
|
public function getId(): ?int |
53
|
|
|
{ |
54
|
|
|
return $this->id; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function getCode(): string |
58
|
|
|
{ |
59
|
|
|
return $this->code; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function setCode(string $code): self |
63
|
|
|
{ |
64
|
|
|
$this->code = $code; |
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function getConstantValue(): int |
69
|
|
|
{ |
70
|
|
|
return $this->constantValue; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function setConstantValue(int $constantValue): self |
74
|
|
|
{ |
75
|
|
|
$this->constantValue = $constantValue; |
76
|
|
|
return $this; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function getTitle(): string |
80
|
|
|
{ |
81
|
|
|
return $this->title; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function setTitle(string $title): self |
85
|
|
|
{ |
86
|
|
|
$this->title = $title; |
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
public function getDescription(): ?string |
91
|
|
|
{ |
92
|
|
|
return $this->description; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function setDescription(?string $description): self |
96
|
|
|
{ |
97
|
|
|
$this->description = $description; |
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function isSystemRole(): bool |
102
|
|
|
{ |
103
|
|
|
return $this->systemRole; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function setSystemRole(bool $systemRole): self |
107
|
|
|
{ |
108
|
|
|
$this->systemRole = $systemRole; |
109
|
|
|
return $this; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function getCreatedAt(): ?DateTime |
113
|
|
|
{ |
114
|
|
|
return $this->createdAt; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
public function setCreatedAt(?DateTime $createdAt): self |
118
|
|
|
{ |
119
|
|
|
$this->createdAt = $createdAt; |
120
|
|
|
return $this; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
public function getCreatedBy(): ?int |
124
|
|
|
{ |
125
|
|
|
return $this->createdBy; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function setCreatedBy(?int $createdBy): self |
129
|
|
|
{ |
130
|
|
|
$this->createdBy = $createdBy; |
131
|
|
|
return $this; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
public function getUpdatedAt(): ?DateTime |
135
|
|
|
{ |
136
|
|
|
return $this->updatedAt; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
public function setUpdatedAt(?DateTime $updatedAt): self |
140
|
|
|
{ |
141
|
|
|
$this->updatedAt = $updatedAt; |
142
|
|
|
return $this; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
public function getUpdatedBy(): ?int |
146
|
|
|
{ |
147
|
|
|
return $this->updatedBy; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
public function setUpdatedBy(?int $updatedBy): self |
151
|
|
|
{ |
152
|
|
|
$this->updatedBy = $updatedBy; |
153
|
|
|
return $this; |
154
|
|
|
} |
155
|
|
|
} |
156
|
|
|
|