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 Chamilo\CoreBundle\Traits\UserTrait; |
10
|
|
|
use Doctrine\ORM\Mapping as ORM; |
11
|
|
|
use Gedmo\Timestampable\Traits\TimestampableEntity; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @ORM\Table( |
15
|
|
|
* name="gradebook_comment", |
16
|
|
|
* indexes={} |
17
|
|
|
* ) |
18
|
|
|
* @ORM\Entity |
19
|
|
|
*/ |
20
|
|
|
class GradebookComment |
21
|
|
|
{ |
22
|
|
|
use UserTrait; |
23
|
|
|
use TimestampableEntity; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @ORM\Column(name="id", type="bigint") |
27
|
|
|
* @ORM\Id |
28
|
|
|
* @ORM\GeneratedValue |
29
|
|
|
*/ |
30
|
|
|
protected int $id; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookComments") |
34
|
|
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") |
35
|
|
|
*/ |
36
|
|
|
protected User $user; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory", inversedBy="comments") |
40
|
|
|
* @ORM\JoinColumn(name="gradebook_id", referencedColumnName="id", onDelete="CASCADE") |
41
|
|
|
*/ |
42
|
|
|
protected GradebookCategory $gradeBook; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @ORM\Column(name="comment", type="text") |
46
|
|
|
*/ |
47
|
|
|
protected ?string $comment; |
48
|
|
|
|
49
|
|
|
public function __construct() |
50
|
|
|
{ |
51
|
|
|
$this->comment = ''; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getUser(): User |
55
|
|
|
{ |
56
|
|
|
return $this->user; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function setUser(User $user): self |
60
|
|
|
{ |
61
|
|
|
$this->user = $user; |
62
|
|
|
|
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getGradeBook(): GradebookCategory |
67
|
|
|
{ |
68
|
|
|
return $this->gradeBook; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function setGradeBook(GradebookCategory $gradeBook): self |
72
|
|
|
{ |
73
|
|
|
$this->gradeBook = $gradeBook; |
74
|
|
|
|
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function getComment(): ?string |
79
|
|
|
{ |
80
|
|
|
return $this->comment; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function setComment(?string $comment): self |
84
|
|
|
{ |
85
|
|
|
$this->comment = $comment; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|