Passed
Push — master ( 661b0b...708b46 )
by Julito
09:18
created

Promotion::setCareer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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\Timestampable\Traits\TimestampableEntity;
11
use Symfony\Component\Validator\Constraints as Assert;
12
13
/**
14
 * Promotion.
15
 *
16
 * @ORM\Table(name="promotion")
17
 * @ORM\Entity
18
 */
19
class Promotion
20
{
21
    use TimestampableEntity;
22
23
    public const PROMOTION_STATUS_ACTIVE = 1;
24
    public const PROMOTION_STATUS_INACTIVE = 0;
25
26
    /**
27
     * @ORM\Column(name="id", type="integer")
28
     * @ORM\Id
29
     * @ORM\GeneratedValue()
30
     */
31
    protected int $id;
32
33
    /**
34
     * @Assert\NotBlank()
35
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
36
     */
37
    protected string $name;
38
39
    /**
40
     * @ORM\Column(name="description", type="text", nullable=false)
41
     */
42
    protected ?string $description;
43
44
    /**
45
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Career")
46
     * @ORM\JoinColumn(name="career_id", referencedColumnName="id")
47
     */
48
    protected Career $career;
49
50
    /**
51
     * @ORM\Column(name="status", type="integer", nullable=false)
52
     */
53
    protected int $status;
54
55
    public function __construct()
56
    {
57
        $this->status = self::PROMOTION_STATUS_ACTIVE;
58
    }
59
60
    /**
61
     * Get id.
62
     *
63
     * @return int
64
     */
65
    public function getId()
66
    {
67
        return $this->id;
68
    }
69
70
    /**
71
     * Set name.
72
     *
73
     * @param string $name
74
     *
75
     * @return Promotion
76
     */
77
    public function setName($name)
78
    {
79
        $this->name = $name;
80
81
        return $this;
82
    }
83
84
    /**
85
     * Get name.
86
     *
87
     * @return string
88
     */
89
    public function getName()
90
    {
91
        return $this->name;
92
    }
93
94
    /**
95
     * Set description.
96
     *
97
     * @param string $description
98
     */
99
    public function setDescription($description): self
100
    {
101
        $this->description = $description;
102
103
        return $this;
104
    }
105
106
    /**
107
     * Get description.
108
     *
109
     * @return string
110
     */
111
    public function getDescription()
112
    {
113
        return $this->description;
114
    }
115
116
    public function setCareer(Career $career): self
117
    {
118
        $this->career = $career;
119
120
        return $this;
121
    }
122
123
    /**
124
     * Get career.
125
     *
126
     * @return Career
127
     */
128
    public function getCareer()
129
    {
130
        return $this->career;
131
    }
132
133
    /**
134
     * Set status.
135
     *
136
     * @param int $status
137
     */
138
    public function setStatus($status): self
139
    {
140
        $this->status = $status;
141
142
        return $this;
143
    }
144
145
    /**
146
     * Get status.
147
     *
148
     * @return int
149
     */
150
    public function getStatus()
151
    {
152
        return $this->status;
153
    }
154
}
155