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 DateTime; |
12
|
|
|
use Doctrine\ORM\Mapping as ORM; |
13
|
|
|
|
14
|
|
|
#[ORM\Table(name: 'c_blog_task_rel_user')] |
15
|
|
|
#[ORM\Entity] |
16
|
|
|
class CBlogTaskRelUser |
17
|
|
|
{ |
18
|
|
|
use UserTrait; |
19
|
|
|
|
20
|
|
|
#[ORM\Column(name: 'iid', type: 'integer')] |
21
|
|
|
#[ORM\Id] |
22
|
|
|
#[ORM\GeneratedValue] |
23
|
|
|
protected ?int $iid = null; |
24
|
|
|
|
25
|
|
|
#[ORM\Column(name: 'target_date', type: 'date', nullable: false)] |
26
|
|
|
protected DateTime $targetDate; |
27
|
|
|
|
28
|
|
|
#[ORM\ManyToOne(targetEntity: CBlogTask::class)] |
29
|
|
|
#[ORM\JoinColumn(name: 'task_id', referencedColumnName: 'iid', onDelete: 'CASCADE')] |
30
|
|
|
protected ?CBlogTask $task = null; |
31
|
|
|
|
32
|
|
|
#[ORM\ManyToOne(targetEntity: CBlog::class)] |
33
|
|
|
#[ORM\JoinColumn(name: 'blog_id', referencedColumnName: 'iid', onDelete: 'CASCADE')] |
34
|
|
|
protected ?CBlog $blog = null; |
35
|
|
|
|
36
|
|
|
#[ORM\ManyToOne(targetEntity: User::class)] |
37
|
|
|
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')] |
38
|
|
|
protected User $user; |
39
|
|
|
|
40
|
|
|
public function getIid(): ?int |
41
|
|
|
{ |
42
|
|
|
return $this->iid; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function getTargetDate(): DateTime |
46
|
|
|
{ |
47
|
|
|
return $this->targetDate; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function setTargetDate(DateTime $targetDate): self |
51
|
|
|
{ |
52
|
|
|
$this->targetDate = $targetDate; |
53
|
|
|
|
54
|
|
|
return $this; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function getTask(): ?CBlogTask |
58
|
|
|
{ |
59
|
|
|
return $this->task; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function setTask(?CBlogTask $task): self |
63
|
|
|
{ |
64
|
|
|
$this->task = $task; |
65
|
|
|
|
66
|
|
|
return $this; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getBlog(): ?CBlog |
70
|
|
|
{ |
71
|
|
|
return $this->blog; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function setBlog(?CBlog $blog): self |
75
|
|
|
{ |
76
|
|
|
$this->blog = $blog; |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
} |
81
|
|
|
|