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

Block::getController()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
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 Chamilo\CoreBundle\Traits\UserTrait;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * Block entity.
14
 */
15
#[ORM\Table(name: 'block')]
16
#[ORM\Entity]
17
class Block
18
{
19
    use UserTrait;
20
21
    #[ORM\Column(name: 'id', type: 'integer')]
22
    #[ORM\Id]
23
    #[ORM\GeneratedValue(strategy: 'IDENTITY')]
24
    protected ?int $id = null;
25
26
    #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: true)]
27
    protected ?string $title = null;
28
29
    #[ORM\Column(name: 'description', type: 'text', nullable: true)]
30
    protected ?string $description = null;
31
32
    #[ORM\Column(name: 'path', type: 'string', length: 190, nullable: false)]
33
    protected string $path;
34
35
    #[ORM\Column(name: 'controller', type: 'string', length: 100, nullable: false)]
36
    protected string $controller;
37
38
    #[ORM\Column(name: 'active', type: 'boolean', nullable: false)]
39
    protected bool $active;
40
41
    #[ORM\OneToOne(inversedBy: 'block', targetEntity: User::class)]
42
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
43
    protected User $user;
44
45
    /**
46
     * Get id.
47
     */
48
    public function getId(): ?int
49
    {
50
        return $this->id;
51
    }
52
53
    public function getTitle(): ?string
54
    {
55
        return $this->title;
56
    }
57
58
    public function setTitle(?string $title): self
59
    {
60
        $this->title = $title;
61
        return $this;
62
    }
63
64
    public function getDescription(): ?string
65
    {
66
        return $this->description;
67
    }
68
69
    public function setDescription(?string $description): self
70
    {
71
        $this->description = $description;
72
        return $this;
73
    }
74
75
    public function getPath(): string
76
    {
77
        return $this->path;
78
    }
79
80
    public function setPath(string $path): self
81
    {
82
        $this->path = $path;
83
        return $this;
84
    }
85
86
    public function getController(): string
87
    {
88
        return $this->controller;
89
    }
90
91
    public function setController(string $controller): self
92
    {
93
        $this->controller = $controller;
94
        return $this;
95
    }
96
97
    public function isActive(): bool
98
    {
99
        return $this->active;
100
    }
101
102
    public function setActive(bool $active): self
103
    {
104
        $this->active = $active;
105
        return $this;
106
    }
107
108
    public function getUser(): User
109
    {
110
        return $this->user;
111
    }
112
113
    public function setUser(User $user): self
114
    {
115
        $this->user = $user;
116
        return $this;
117
    }
118
}
119