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\Course; |
10
|
|
|
use Chamilo\CoreBundle\Entity\Session; |
11
|
|
|
use Chamilo\CoreBundle\Entity\Usergroup; |
12
|
|
|
use Doctrine\ORM\Mapping as ORM; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* CGroupRelUsergroup. |
16
|
|
|
*/ |
17
|
|
|
#[ORM\Table(name: 'c_group_rel_usergroup')] |
18
|
|
|
#[ORM\Entity] |
19
|
|
|
class CGroupRelUsergroup |
20
|
|
|
{ |
21
|
|
|
#[ORM\Id] |
22
|
|
|
#[ORM\GeneratedValue] |
23
|
|
|
#[ORM\Column(type: 'integer')] |
24
|
|
|
protected ?int $id = null; |
25
|
|
|
|
26
|
|
|
#[ORM\ManyToOne(targetEntity: CGroup::class)] |
27
|
|
|
#[ORM\JoinColumn(name: 'group_id', referencedColumnName: 'iid', nullable: false, onDelete: 'CASCADE')] |
28
|
|
|
protected CGroup $group; |
29
|
|
|
|
30
|
|
|
#[ORM\ManyToOne(targetEntity: Usergroup::class)] |
31
|
|
|
#[ORM\JoinColumn(name: 'usergroup_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')] |
32
|
|
|
protected Usergroup $usergroup; |
33
|
|
|
|
34
|
|
|
#[ORM\ManyToOne(targetEntity: Session::class)] |
35
|
|
|
#[ORM\JoinColumn(name: 'session_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')] |
36
|
|
|
protected ?Session $session = null; |
37
|
|
|
|
38
|
|
|
#[ORM\ManyToOne(targetEntity: Course::class)] |
39
|
|
|
#[ORM\JoinColumn(name: 'c_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')] |
40
|
|
|
protected ?Course $course = null; |
41
|
|
|
|
42
|
|
|
#[ORM\Column(name: 'ready_autogroup', type: 'boolean', nullable: false)] |
43
|
|
|
protected bool $readyAutogroup; |
44
|
|
|
|
45
|
|
|
public function getId(): ?int |
46
|
|
|
{ |
47
|
|
|
return $this->id; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function getGroup(): CGroup |
51
|
|
|
{ |
52
|
|
|
return $this->group; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function setGroup(CGroup $group): self |
56
|
|
|
{ |
57
|
|
|
$this->group = $group; |
58
|
|
|
return $this; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function getUsergroup(): Usergroup |
62
|
|
|
{ |
63
|
|
|
return $this->usergroup; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function setUsergroup(Usergroup $usergroup): self |
67
|
|
|
{ |
68
|
|
|
$this->usergroup = $usergroup; |
69
|
|
|
return $this; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
public function getSession(): ?Session |
73
|
|
|
{ |
74
|
|
|
return $this->session; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function setSession(?Session $session): self |
78
|
|
|
{ |
79
|
|
|
$this->session = $session; |
80
|
|
|
return $this; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function getCourse(): ?Course |
84
|
|
|
{ |
85
|
|
|
return $this->course; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function setCourse(?Course $course): self |
89
|
|
|
{ |
90
|
|
|
$this->course = $course; |
91
|
|
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function isReadyAutogroup(): bool |
95
|
|
|
{ |
96
|
|
|
return $this->readyAutogroup; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function setReadyAutogroup(bool $readyAutogroup): self |
100
|
|
|
{ |
101
|
|
|
$this->readyAutogroup = $readyAutogroup; |
102
|
|
|
return $this; |
103
|
|
|
} |
104
|
|
|
} |
105
|
|
|
|