Passed
Push — master ( 7dce27...7fa20f )
by Yannick
08:15
created

PageLayout::getUpdatedBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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 ApiPlatform\Metadata\ApiResource;
10
use Chamilo\CoreBundle\Entity\PageLayoutTemplate;
11
use Chamilo\CoreBundle\Entity\User;
12
use Symfony\Component\Serializer\Annotation\Groups;
13
use Doctrine\ORM\Mapping as ORM;
14
15
/**
16
 * PageLayout entity.
17
 */
18
#[ApiResource(
19
    normalizationContext: ['groups' => ['page_layout:read']],
20
    denormalizationContext: ['groups' => ['page_layout:write']]
21
)]
22
#[ORM\Table(name: 'page_layout')]
23
#[ORM\Entity]
24
class PageLayout
25
{
26
    #[Groups(['page_layout:read'])]
27
    #[ORM\Id]
28
    #[ORM\GeneratedValue(strategy: 'IDENTITY')]
29
    #[ORM\Column(name: 'id', type: 'integer')]
30
    private ?int $id = null;
31
32
    #[Groups(['page_layout:read', 'page_layout:write'])]
33
    #[ORM\Column(name: 'url', type: 'text', nullable: false)]
34
    private string $url;
35
36
    #[Groups(['page_layout:read', 'page_layout:write'])]
37
    #[ORM\Column(name: 'roles', type: 'text', nullable: true)]
38
    private ?string $roles = null;
39
40
    #[Groups(['page_layout:read', 'page_layout:write'])]
41
    #[ORM\ManyToOne(targetEntity: PageLayoutTemplate::class)]
42
    #[ORM\JoinColumn(name: 'page_layout_template_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
43
    private ?PageLayoutTemplate $pageLayoutTemplate = null;
44
45
    #[Groups(['page_layout:read', 'page_layout:write'])]
46
    #[ORM\Column(name: 'layout', type: 'text', nullable: false)]
47
    private string $layout;
48
49
    #[Groups(['page_layout:read'])]
50
    #[ORM\Column(name: 'created_at', type: 'datetime', nullable: true)]
51
    private ?\DateTimeInterface $createdAt = null;
52
53
    #[Groups(['page_layout:read'])]
54
    #[ORM\Column(name: 'updated_at', type: 'datetime', nullable: true)]
55
    private ?\DateTimeInterface $updatedAt = null;
56
57
    #[Groups(['page_layout:read'])]
58
    #[ORM\OneToOne(targetEntity: User::class)]
59
    #[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
60
    private ?User $createdBy = null;
61
62
    #[Groups(['page_layout:read'])]
63
    #[ORM\OneToOne(targetEntity: User::class)]
64
    #[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
65
    private ?User $updatedBy = null;
66
67
    public function getId(): ?int
68
    {
69
        return $this->id;
70
    }
71
72
    public function getUrl(): string
73
    {
74
        return $this->url;
75
    }
76
77
    public function setUrl(string $url): self
78
    {
79
        $this->url = $url;
80
81
        return $this;
82
    }
83
84
    public function getRoles(): ?string
85
    {
86
        return $this->roles;
87
    }
88
89
    public function setRoles(?string $roles): self
90
    {
91
        $this->roles = $roles;
92
93
        return $this;
94
    }
95
96
    public function getPageLayoutTemplate(): ?PageLayoutTemplate
97
    {
98
        return $this->pageLayoutTemplate;
99
    }
100
101
    public function setPageLayoutTemplate(?PageLayoutTemplate $template): self
102
    {
103
        $this->pageLayoutTemplate = $template;
104
105
        return $this;
106
    }
107
108
    public function getLayout(): string
109
    {
110
        return $this->layout;
111
    }
112
113
    public function setLayout(string $layout): self
114
    {
115
        $this->layout = $layout;
116
117
        return $this;
118
    }
119
120
    public function getCreatedAt(): ?\DateTimeInterface
121
    {
122
        return $this->createdAt;
123
    }
124
125
    public function setCreatedAt(?\DateTimeInterface $createdAt): self
126
    {
127
        $this->createdAt = $createdAt;
128
129
        return $this;
130
    }
131
132
    public function getUpdatedAt(): ?\DateTimeInterface
133
    {
134
        return $this->updatedAt;
135
    }
136
137
    public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
138
    {
139
        $this->updatedAt = $updatedAt;
140
141
        return $this;
142
    }
143
144
    public function getCreatedBy(): ?User
145
    {
146
        return $this->createdBy;
147
    }
148
149
    public function setCreatedBy(?User $user): self
150
    {
151
        $this->createdBy = $user;
152
153
        return $this;
154
    }
155
156
    public function getUpdatedBy(): ?User
157
    {
158
        return $this->updatedBy;
159
    }
160
161
    public function setUpdatedBy(?User $user): self
162
    {
163
        $this->updatedBy = $user;
164
165
        return $this;
166
    }
167
}
168