Passed
Push — master ( a4ff3f...38d427 )
by Yannick
07:05 queued 27s
created

SystemTemplate::getImage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
    #[ORM\ManyToOne(targetEntity: Asset::class, cascade: ['persist'])]
30
    #[ORM\JoinColumn(name: 'image_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
31
    protected ?Asset $image = null;
32
33
34
    #[ORM\Column(name: 'content', type: 'text', nullable: false)]
35
    protected string $content;
36
37
    #[ORM\Column(name: 'language', type: 'string', length: 40, nullable: true)]
38
    protected string $language;
39
40
    public function __construct()
41
    {
42
        $this->comment = '';
43
    }
44
45
    public function setTitle(string $title): self
46
    {
47
        $this->title = $title;
48
49
        return $this;
50
    }
51
52
    /**
53
     * Get title.
54
     *
55
     * @return string
56
     */
57
    public function getTitle()
58
    {
59
        return $this->title;
60
    }
61
62
    public function setComment(string $comment): self
63
    {
64
        $this->comment = $comment;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Get comment.
71
     *
72
     * @return string
73
     */
74
    public function getComment()
75
    {
76
        return $this->comment;
77
    }
78
79
    public function getImage(): ?Asset
80
    {
81
        return $this->image;
82
    }
83
84
    public function setImage(?Asset $image): self
85
    {
86
        $this->image = $image;
87
88
        return $this;
89
    }
90
91
    public function hasImage(): bool
92
    {
93
        return null !== $this->image;
94
    }
95
96
    public function setContent(string $content): self
97
    {
98
        $this->content = $content;
99
100
        return $this;
101
    }
102
103
    /**
104
     * Get content.
105
     *
106
     * @return string
107
     */
108
    public function getContent()
109
    {
110
        return $this->content;
111
    }
112
113
    /**
114
     * Get id.
115
     *
116
     * @return int
117
     */
118
    public function getId()
119
    {
120
        return $this->id;
121
    }
122
123
    public function getLanguage(): string
124
    {
125
        return $this->language;
126
    }
127
128
    public function setLanguage(string $language): self
129
    {
130
        $this->language = $language;
131
132
        return $this;
133
    }
134
}
135