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\ExtraFieldOptionsRepository; |
10
|
|
|
use Doctrine\ORM\Mapping as ORM; |
11
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
12
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
13
|
|
|
|
14
|
|
|
#[ORM\Table(name: 'extra_field_options')] |
15
|
|
|
#[ORM\Entity(repositoryClass: ExtraFieldOptionsRepository::class)] |
16
|
|
|
#[ORM\MappedSuperclass] |
17
|
|
|
class ExtraFieldOptions |
18
|
|
|
{ |
19
|
|
|
#[ORM\Column(name: 'id', type: 'integer')] |
20
|
|
|
#[ORM\Id] |
21
|
|
|
#[ORM\GeneratedValue] |
22
|
|
|
protected ?int $id = null; |
23
|
|
|
|
24
|
|
|
#[Assert\NotNull] |
25
|
|
|
#[ORM\ManyToOne(targetEntity: ExtraField::class, inversedBy: 'options')] |
26
|
|
|
#[ORM\JoinColumn(name: 'field_id', referencedColumnName: 'id')] |
27
|
|
|
protected ExtraField $field; |
28
|
|
|
|
29
|
|
|
#[ORM\Column(name: 'option_value', type: 'text', nullable: true)] |
30
|
|
|
protected ?string $value = null; |
31
|
|
|
|
32
|
|
|
#[Gedmo\Translatable] |
33
|
|
|
#[ORM\Column(name: 'display_text', type: 'string', length: 255, nullable: true)] |
34
|
|
|
protected ?string $displayText = null; |
35
|
|
|
|
36
|
|
|
#[ORM\Column(name: 'priority', type: 'string', length: 255, nullable: true)] |
37
|
|
|
protected ?string $priority = null; |
38
|
|
|
|
39
|
|
|
#[ORM\Column(name: 'priority_message', type: 'string', length: 255, nullable: true)] |
40
|
|
|
protected ?string $priorityMessage = null; |
41
|
|
|
|
42
|
|
|
#[ORM\Column(name: 'option_order', type: 'integer', nullable: true)] |
43
|
|
|
protected ?int $optionOrder = null; |
44
|
|
|
|
45
|
|
|
#[Gedmo\Locale] |
46
|
|
|
private ?string $locale = null; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return int |
50
|
|
|
*/ |
51
|
|
|
public function getId() |
52
|
|
|
{ |
53
|
|
|
return $this->id; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return int |
58
|
|
|
*/ |
59
|
|
|
public function getOptionOrder() |
60
|
|
|
{ |
61
|
|
|
return $this->optionOrder; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function setOptionOrder(int $optionOrder): self |
65
|
|
|
{ |
66
|
|
|
$this->optionOrder = $optionOrder; |
67
|
|
|
|
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function getField(): ExtraField |
72
|
|
|
{ |
73
|
|
|
return $this->field; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function setField(ExtraField $field): self |
77
|
|
|
{ |
78
|
|
|
$this->field = $field; |
79
|
|
|
|
80
|
|
|
return $this; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @return string |
85
|
|
|
*/ |
86
|
|
|
public function getValue() |
87
|
|
|
{ |
88
|
|
|
return $this->value; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
public function setValue(string $value): self |
92
|
|
|
{ |
93
|
|
|
$this->value = $value; |
94
|
|
|
|
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return string |
100
|
|
|
*/ |
101
|
|
|
public function getDisplayText() |
102
|
|
|
{ |
103
|
|
|
return $this->displayText; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function setDisplayText(string $displayText): self |
107
|
|
|
{ |
108
|
|
|
$this->displayText = $displayText; |
109
|
|
|
|
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function getPriority(): ?string |
114
|
|
|
{ |
115
|
|
|
return $this->priority; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function setPriority(string $priority): self |
119
|
|
|
{ |
120
|
|
|
$this->priority = $priority; |
121
|
|
|
|
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
public function getPriorityMessage(): ?string |
126
|
|
|
{ |
127
|
|
|
return $this->priorityMessage; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
public function setPriorityMessage(string $priorityMessage): self |
131
|
|
|
{ |
132
|
|
|
$this->priorityMessage = $priorityMessage; |
133
|
|
|
|
134
|
|
|
return $this; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
public function getLocale(): string |
138
|
|
|
{ |
139
|
|
|
return $this->locale; |
|
|
|
|
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
public function setLocale(string $locale): self |
143
|
|
|
{ |
144
|
|
|
$this->locale = $locale; |
145
|
|
|
|
146
|
|
|
return $this; |
147
|
|
|
} |
148
|
|
|
} |
149
|
|
|
|