Passed
Push — master ( 6749c8...cb1098 )
by Angel Fernando Quiroz
29:59 queued 21:13
created

ExtraFieldOptions   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 125
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 46
c 0
b 0
f 0
dl 0
loc 125
rs 10
wmc 14

14 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getValue() 0 3 1
A setField() 0 5 1
A setOptionOrder() 0 5 1
A setValue() 0 5 1
A getField() 0 3 1
A getOptionOrder() 0 3 1
A setPriorityMessage() 0 5 1
A setDisplayText() 0 5 1
A getPriorityMessage() 0 3 1
A setPriority() 0 5 1
A getDisplayText() 0 3 1
A getPriority() 0 3 1
A setTranslatableLocale() 0 5 1
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
    public function getDisplayText(): ?string
99
    {
100
        return $this->displayText;
101
    }
102
103
    public function setDisplayText(string $displayText): self
104
    {
105
        $this->displayText = $displayText;
106
107
        return $this;
108
    }
109
110
    public function getPriority(): ?string
111
    {
112
        return $this->priority;
113
    }
114
115
    public function setPriority(string $priority): self
116
    {
117
        $this->priority = $priority;
118
119
        return $this;
120
    }
121
122
    public function getPriorityMessage(): ?string
123
    {
124
        return $this->priorityMessage;
125
    }
126
127
    public function setPriorityMessage(string $priorityMessage): self
128
    {
129
        $this->priorityMessage = $priorityMessage;
130
131
        return $this;
132
    }
133
134
    public function setTranslatableLocale(string $locale): self
135
    {
136
        $this->locale = $locale;
137
138
        return $this;
139
    }
140
}
141