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 Doctrine\ORM\Mapping as ORM; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* SystemTemplate. |
13
|
|
|
*/ |
14
|
|
|
#[ORM\Table(name: 'system_template')] |
15
|
|
|
#[ORM\Entity] |
16
|
|
|
class SystemTemplate |
17
|
|
|
{ |
18
|
|
|
#[ORM\Column(name: 'id', type: 'integer')] |
19
|
|
|
#[ORM\Id] |
20
|
|
|
#[ORM\GeneratedValue] |
21
|
|
|
protected ?int $id = null; |
22
|
|
|
|
23
|
|
|
#[ORM\Column(name: 'title', type: 'string', length: 250, nullable: false)] |
24
|
|
|
protected string $title; |
25
|
|
|
|
26
|
|
|
#[ORM\Column(name: 'comment', type: 'text', nullable: false)] |
27
|
|
|
protected string $comment; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Asset", cascade={"persist"} ) |
31
|
|
|
* @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="SET NULL") |
32
|
|
|
*/ |
33
|
|
|
protected ?Asset $image = null; |
34
|
|
|
|
35
|
|
|
|
36
|
|
|
#[ORM\Column(name: 'content', type: 'text', nullable: false)] |
37
|
|
|
protected string $content; |
38
|
|
|
|
39
|
|
|
#[ORM\Column(name: 'language', type: 'string', length: 40, nullable: true)] |
40
|
|
|
protected string $language; |
41
|
|
|
|
42
|
|
|
public function __construct() |
43
|
|
|
{ |
44
|
|
|
$this->comment = ''; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function setTitle(string $title): self |
48
|
|
|
{ |
49
|
|
|
$this->title = $title; |
50
|
|
|
|
51
|
|
|
return $this; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Get title. |
56
|
|
|
* |
57
|
|
|
* @return string |
58
|
|
|
*/ |
59
|
|
|
public function getTitle() |
60
|
|
|
{ |
61
|
|
|
return $this->title; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function setComment(string $comment): self |
65
|
|
|
{ |
66
|
|
|
$this->comment = $comment; |
67
|
|
|
|
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Get comment. |
73
|
|
|
* |
74
|
|
|
* @return string |
75
|
|
|
*/ |
76
|
|
|
public function getComment() |
77
|
|
|
{ |
78
|
|
|
return $this->comment; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function getImage(): ?Asset |
82
|
|
|
{ |
83
|
|
|
return $this->image; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
public function setImage(?Asset $image): self |
87
|
|
|
{ |
88
|
|
|
$this->image = $image; |
89
|
|
|
|
90
|
|
|
return $this; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
public function hasImage(): bool |
94
|
|
|
{ |
95
|
|
|
return null !== $this->image; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function setContent(string $content): self |
99
|
|
|
{ |
100
|
|
|
$this->content = $content; |
101
|
|
|
|
102
|
|
|
return $this; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Get content. |
107
|
|
|
* |
108
|
|
|
* @return string |
109
|
|
|
*/ |
110
|
|
|
public function getContent() |
111
|
|
|
{ |
112
|
|
|
return $this->content; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Get id. |
117
|
|
|
* |
118
|
|
|
* @return int |
119
|
|
|
*/ |
120
|
|
|
public function getId() |
121
|
|
|
{ |
122
|
|
|
return $this->id; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
public function getLanguage(): string |
126
|
|
|
{ |
127
|
|
|
return $this->language; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
public function setLanguage(string $language): self |
131
|
|
|
{ |
132
|
|
|
$this->language = $language; |
133
|
|
|
|
134
|
|
|
return $this; |
135
|
|
|
} |
136
|
|
|
} |
137
|
|
|
|