|
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\Common\Collections\ArrayCollection; |
|
10
|
|
|
use Doctrine\Common\Collections\Collection; |
|
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
12
|
|
|
use Gedmo\Timestampable\Traits\TimestampableEntity; |
|
13
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Career. |
|
17
|
|
|
* |
|
18
|
|
|
* @ORM\Table(name="career") |
|
19
|
|
|
* @ORM\Entity |
|
20
|
|
|
*/ |
|
21
|
|
|
class Career |
|
22
|
|
|
{ |
|
23
|
|
|
use TimestampableEntity; |
|
24
|
|
|
|
|
25
|
|
|
public const CAREER_STATUS_ACTIVE = 1; |
|
26
|
|
|
public const CAREER_STATUS_INACTIVE = 0; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @ORM\Column(name="id", type="integer") |
|
30
|
|
|
* @ORM\Id |
|
31
|
|
|
* @ORM\GeneratedValue() |
|
32
|
|
|
*/ |
|
33
|
|
|
protected int $id; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @Assert\NotBlank() |
|
37
|
|
|
* @ORM\Column(name="name", type="string", length=255, nullable=false) |
|
38
|
|
|
*/ |
|
39
|
|
|
protected string $name; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @ORM\Column(name="description", type="text", nullable=false) |
|
43
|
|
|
*/ |
|
44
|
|
|
protected ?string $description = null; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @ORM\Column(name="status", type="integer", nullable=false) |
|
48
|
|
|
*/ |
|
49
|
|
|
protected int $status; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var Collection|Promotion[] |
|
53
|
|
|
* |
|
54
|
|
|
* @ORM\OneToMany( |
|
55
|
|
|
* targetEntity="Chamilo\CoreBundle\Entity\Promotion", mappedBy="career", cascade={"persist"} |
|
56
|
|
|
* ) |
|
57
|
|
|
*/ |
|
58
|
|
|
protected Collection $promotions; |
|
59
|
|
|
|
|
60
|
|
|
public function __construct() |
|
61
|
|
|
{ |
|
62
|
|
|
$this->status = self::CAREER_STATUS_ACTIVE; |
|
63
|
|
|
$this->promotions = new ArrayCollection(); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* Get id. |
|
68
|
|
|
* |
|
69
|
|
|
* @return int |
|
70
|
|
|
*/ |
|
71
|
|
|
public function getId() |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->id; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function setName(string $name): self |
|
77
|
|
|
{ |
|
78
|
|
|
$this->name = $name; |
|
79
|
|
|
|
|
80
|
|
|
return $this; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function getName(): string |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->name; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function setDescription(string $description): self |
|
89
|
|
|
{ |
|
90
|
|
|
$this->description = $description; |
|
91
|
|
|
|
|
92
|
|
|
return $this; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
public function getDescription(): ?string |
|
96
|
|
|
{ |
|
97
|
|
|
return $this->description; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
public function setStatus(int $status): self |
|
101
|
|
|
{ |
|
102
|
|
|
$this->status = $status; |
|
103
|
|
|
|
|
104
|
|
|
return $this; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
public function getStatus(): int |
|
108
|
|
|
{ |
|
109
|
|
|
return $this->status; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
public function getPromotions(): array | ArrayCollection | Collection |
|
113
|
|
|
{ |
|
114
|
|
|
return $this->promotions; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
public function setPromotions(Collection $promotions): self |
|
118
|
|
|
{ |
|
119
|
|
|
$this->promotions = $promotions; |
|
120
|
|
|
|
|
121
|
|
|
return $this; |
|
122
|
|
|
} |
|
123
|
|
|
} |
|
124
|
|
|
|