|
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 Doctrine\ORM\Mapping as ORM; |
|
11
|
|
|
|
|
12
|
|
|
#[ORM\Table(name: 'c_blog_comment')] |
|
13
|
|
|
#[ORM\Entity] |
|
14
|
|
|
class CBlogComment |
|
15
|
|
|
{ |
|
16
|
|
|
#[ORM\Column(name: 'iid', type: 'integer')] |
|
17
|
|
|
#[ORM\Id] |
|
18
|
|
|
#[ORM\GeneratedValue] |
|
19
|
|
|
protected ?int $iid = null; |
|
20
|
|
|
|
|
21
|
|
|
#[ORM\Column(name: 'comment_id', type: 'integer', nullable: false)] |
|
22
|
|
|
protected int $commentId; |
|
23
|
|
|
|
|
24
|
|
|
#[ORM\Column(name: 'title', type: 'string', length: 250, nullable: false)] |
|
25
|
|
|
protected string $title; |
|
26
|
|
|
|
|
27
|
|
|
#[ORM\Column(name: 'comment', type: 'text', nullable: false)] |
|
28
|
|
|
protected string $comment; |
|
29
|
|
|
|
|
30
|
|
|
#[ORM\ManyToOne(targetEntity: User::class)] |
|
31
|
|
|
#[ORM\JoinColumn(name: 'author_id', referencedColumnName: 'id', onDelete: 'CASCADE')] |
|
32
|
|
|
protected User $author; |
|
33
|
|
|
|
|
34
|
|
|
#[ORM\Column(name: 'date_creation', type: 'datetime', nullable: false)] |
|
35
|
|
|
protected \DateTime $dateCreation; |
|
36
|
|
|
|
|
37
|
|
|
#[ORM\ManyToOne(targetEntity: CBlog::class)] |
|
38
|
|
|
#[ORM\JoinColumn(name: 'blog_id', referencedColumnName: 'iid', onDelete: 'CASCADE')] |
|
39
|
|
|
protected ?CBlog $blog = null; |
|
40
|
|
|
|
|
41
|
|
|
public function getIid(): ?int |
|
42
|
|
|
{ |
|
43
|
|
|
return $this->iid; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function getCommentId(): int |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->commentId; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function setCommentId(int $commentId): self |
|
52
|
|
|
{ |
|
53
|
|
|
$this->commentId = $commentId; |
|
54
|
|
|
|
|
55
|
|
|
return $this; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function getTitle(): string |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->title; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function setTitle(string $title): self |
|
64
|
|
|
{ |
|
65
|
|
|
$this->title = $title; |
|
66
|
|
|
|
|
67
|
|
|
return $this; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function getComment(): string |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->comment; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function setComment(string $comment): self |
|
76
|
|
|
{ |
|
77
|
|
|
$this->comment = $comment; |
|
78
|
|
|
|
|
79
|
|
|
return $this; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function getAuthor(): User |
|
83
|
|
|
{ |
|
84
|
|
|
return $this->author; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function setAuthor(User $author): self |
|
88
|
|
|
{ |
|
89
|
|
|
$this->author = $author; |
|
90
|
|
|
|
|
91
|
|
|
return $this; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function getDateCreation(): \DateTime |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->dateCreation; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function setDateCreation(\DateTime $dateCreation): self |
|
100
|
|
|
{ |
|
101
|
|
|
$this->dateCreation = $dateCreation; |
|
102
|
|
|
|
|
103
|
|
|
return $this; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public function getBlog(): ?CBlog |
|
107
|
|
|
{ |
|
108
|
|
|
return $this->blog; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
public function setBlog(?CBlog $blog): self |
|
112
|
|
|
{ |
|
113
|
|
|
$this->blog = $blog; |
|
114
|
|
|
|
|
115
|
|
|
return $this; |
|
116
|
|
|
} |
|
117
|
|
|
} |
|
118
|
|
|
|