|
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 Doctrine\ORM\Mapping as ORM; |
|
10
|
|
|
|
|
11
|
|
|
#[ORM\Table(name: 'c_blog_attachment')] |
|
12
|
|
|
#[ORM\Entity] |
|
13
|
|
|
class CBlogAttachment |
|
14
|
|
|
{ |
|
15
|
|
|
#[ORM\Column(name: 'iid', type: 'integer')] |
|
16
|
|
|
#[ORM\Id] |
|
17
|
|
|
#[ORM\GeneratedValue] |
|
18
|
|
|
protected ?int $iid = null; |
|
19
|
|
|
|
|
20
|
|
|
#[ORM\Column(name: 'path', type: 'string', length: 255, nullable: false)] |
|
21
|
|
|
protected string $path; |
|
22
|
|
|
|
|
23
|
|
|
#[ORM\Column(name: 'comment', type: 'text', nullable: true)] |
|
24
|
|
|
protected ?string $comment = null; |
|
25
|
|
|
|
|
26
|
|
|
#[ORM\Column(name: 'size', type: 'integer', nullable: false)] |
|
27
|
|
|
protected int $size; |
|
28
|
|
|
|
|
29
|
|
|
#[ORM\Column(name: 'filename', type: 'string', length: 255, nullable: false)] |
|
30
|
|
|
protected string $filename; |
|
31
|
|
|
|
|
32
|
|
|
#[ORM\ManyToOne(targetEntity: CBlog::class, inversedBy: 'attachments')] |
|
33
|
|
|
#[ORM\JoinColumn(name: 'blog_id', referencedColumnName: 'iid', onDelete: 'CASCADE')] |
|
34
|
|
|
protected ?CBlog $blog = null; |
|
35
|
|
|
|
|
36
|
|
|
public function getIid(): ?int |
|
37
|
|
|
{ |
|
38
|
|
|
return $this->iid; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function getPath(): string |
|
42
|
|
|
{ |
|
43
|
|
|
return $this->path; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function setPath(string $path): self |
|
47
|
|
|
{ |
|
48
|
|
|
$this->path = $path; |
|
49
|
|
|
|
|
50
|
|
|
return $this; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function getComment(): ?string |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->comment; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function setComment(?string $comment): self |
|
59
|
|
|
{ |
|
60
|
|
|
$this->comment = $comment; |
|
61
|
|
|
|
|
62
|
|
|
return $this; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getSize(): int |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->size; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function setSize(int $size): self |
|
71
|
|
|
{ |
|
72
|
|
|
$this->size = $size; |
|
73
|
|
|
|
|
74
|
|
|
return $this; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function getFilename(): string |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->filename; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function setFilename(string $filename): self |
|
83
|
|
|
{ |
|
84
|
|
|
$this->filename = $filename; |
|
85
|
|
|
|
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function getBlog(): ?CBlog |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->blog; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function setBlog(?CBlog $blog): self |
|
95
|
|
|
{ |
|
96
|
|
|
$this->blog = $blog; |
|
97
|
|
|
|
|
98
|
|
|
return $this; |
|
99
|
|
|
} |
|
100
|
|
|
} |
|
101
|
|
|
|