|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
|
6
|
|
|
|
|
7
|
|
|
namespace Chamilo\CourseBundle\Entity; |
|
8
|
|
|
|
|
9
|
|
|
use Chamilo\CoreBundle\Entity\User; |
|
10
|
|
|
use Chamilo\CoreBundle\Traits\UserTrait; |
|
11
|
|
|
use Chamilo\CourseBundle\Entity\CLp; |
|
12
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* C_lp_user_access |
|
16
|
|
|
* Represents the access of users to learning paths (LP). |
|
17
|
|
|
*/ |
|
18
|
|
|
#[ORM\Table(name: 'c_lp_user_access')] |
|
19
|
|
|
#[ORM\Entity] |
|
20
|
|
|
class CLpUserAccess |
|
21
|
|
|
{ |
|
22
|
|
|
use UserTrait; |
|
23
|
|
|
|
|
24
|
|
|
#[ORM\Id] |
|
25
|
|
|
#[ORM\GeneratedValue] |
|
26
|
|
|
#[ORM\Column(type: 'integer')] |
|
27
|
|
|
protected ?int $id = null; |
|
28
|
|
|
|
|
29
|
|
|
#[ORM\ManyToOne(targetEntity: User::class)] |
|
30
|
|
|
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')] |
|
31
|
|
|
protected ?User $user = null; |
|
32
|
|
|
|
|
33
|
|
|
#[ORM\ManyToOne(targetEntity: CLp::class)] |
|
34
|
|
|
#[ORM\JoinColumn(name: 'lp_id', referencedColumnName: 'iid', nullable: true, onDelete: 'SET NULL')] |
|
35
|
|
|
protected ?CLp $lp = null; |
|
36
|
|
|
|
|
37
|
|
|
#[ORM\Column(name: 'start_date', type: 'datetime', nullable: true)] |
|
38
|
|
|
protected ?\DateTimeInterface $startDate = null; |
|
39
|
|
|
|
|
40
|
|
|
#[ORM\Column(name: 'end_date', type: 'datetime', nullable: true)] |
|
41
|
|
|
protected ?\DateTimeInterface $endDate = null; |
|
42
|
|
|
|
|
43
|
|
|
#[ORM\Column(name: 'is_open_without_date', type: 'boolean', options: ['default' => 0], nullable: true)] |
|
44
|
|
|
protected ?bool $isOpenWithoutDate = false; |
|
45
|
|
|
|
|
46
|
|
|
public function __construct() |
|
47
|
|
|
{ |
|
48
|
|
|
$this->isOpenWithoutDate = false; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function getId(): ?int |
|
52
|
|
|
{ |
|
53
|
|
|
return $this->id; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function getLp(): ?CLp |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->lp; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function setLp(?CLp $lp): self |
|
62
|
|
|
{ |
|
63
|
|
|
$this->lp = $lp; |
|
64
|
|
|
|
|
65
|
|
|
return $this; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function getStartDate(): ?\DateTimeInterface |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->startDate; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function setStartDate(?\DateTimeInterface $startDate): self |
|
74
|
|
|
{ |
|
75
|
|
|
$this->startDate = $startDate; |
|
76
|
|
|
|
|
77
|
|
|
return $this; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
public function getEndDate(): ?\DateTimeInterface |
|
81
|
|
|
{ |
|
82
|
|
|
return $this->endDate; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public function setEndDate(?\DateTimeInterface $endDate): self |
|
86
|
|
|
{ |
|
87
|
|
|
$this->endDate = $endDate; |
|
88
|
|
|
|
|
89
|
|
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function getIsOpenWithoutDate(): ?bool |
|
93
|
|
|
{ |
|
94
|
|
|
return $this->isOpenWithoutDate; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function setIsOpenWithoutDate(?bool $isOpenWithoutDate): self |
|
98
|
|
|
{ |
|
99
|
|
|
$this->isOpenWithoutDate = $isOpenWithoutDate; |
|
100
|
|
|
|
|
101
|
|
|
return $this; |
|
102
|
|
|
} |
|
103
|
|
|
} |
|
104
|
|
|
|