Passed
Pull Request — master (#5720)
by
unknown
07:05
created

CBlogPost::setDateCreation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
rs 10
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_post')]
13
#[ORM\Entity]
14
class CBlogPost
15
{
16
    #[ORM\Column(name: 'iid', type: 'integer')]
17
    #[ORM\Id]
18
    #[ORM\GeneratedValue]
19
    protected ?int $iid = null;
20
21
    #[ORM\Column(name: 'title', type: 'string', length: 250, nullable: false)]
22
    protected string $title;
23
24
    #[ORM\Column(name: 'full_text', type: 'text', nullable: false)]
25
    protected string $fullText;
26
27
    #[ORM\Column(name: 'date_creation', type: 'datetime', nullable: false)]
28
    protected \DateTime $dateCreation;
29
30
    #[ORM\ManyToOne(targetEntity: User::class)]
31
    #[ORM\JoinColumn(name: 'author_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
32
    protected User $author;
33
34
    #[ORM\ManyToOne(targetEntity: CBlog::class)]
35
    #[ORM\JoinColumn(name: 'blog_id', referencedColumnName: 'iid', onDelete: 'CASCADE')]
36
    protected ?CBlog $blog = null;
37
38
    public function getIid(): ?int
39
    {
40
        return $this->iid;
41
    }
42
43
    public function getTitle(): string
44
    {
45
        return $this->title;
46
    }
47
48
    public function setTitle(string $title): self
49
    {
50
        $this->title = $title;
51
52
        return $this;
53
    }
54
55
    public function getFullText(): string
56
    {
57
        return $this->fullText;
58
    }
59
60
    public function setFullText(string $fullText): self
61
    {
62
        $this->fullText = $fullText;
63
64
        return $this;
65
    }
66
67
    public function getDateCreation(): \DateTime
68
    {
69
        return $this->dateCreation;
70
    }
71
72
    public function setDateCreation(\DateTime $dateCreation): self
73
    {
74
        $this->dateCreation = $dateCreation;
75
76
        return $this;
77
    }
78
79
    public function getAuthor(): User
80
    {
81
        return $this->author;
82
    }
83
84
    public function setAuthor(User $author): self
85
    {
86
        $this->author = $author;
87
88
        return $this;
89
    }
90
91
    public function getBlog(): ?CBlog
92
    {
93
        return $this->blog;
94
    }
95
96
    public function setBlog(?CBlog $blog): self
97
    {
98
        $this->blog = $blog;
99
100
        return $this;
101
    }
102
}
103