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