Passed
Push — master ( 13676e...aac741 )
by Angel Fernando Quiroz
08:31 queued 15s
created

Block::setUser()   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
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 1
nc 1
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(targetEntity: User::class)]
42
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
43
    private ?User $user = null;
0 ignored issues
show
introduced by
The private property $user is not used, and could be removed.
Loading history...
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
62
        return $this;
63
    }
64
65
    public function getDescription(): ?string
66
    {
67
        return $this->description;
68
    }
69
70
    public function setDescription(?string $description): self
71
    {
72
        $this->description = $description;
73
74
        return $this;
75
    }
76
77
    public function getPath(): string
78
    {
79
        return $this->path;
80
    }
81
82
    public function setPath(string $path): self
83
    {
84
        $this->path = $path;
85
86
        return $this;
87
    }
88
89
    public function getController(): string
90
    {
91
        return $this->controller;
92
    }
93
94
    public function setController(string $controller): self
95
    {
96
        $this->controller = $controller;
97
98
        return $this;
99
    }
100
101
    public function isActive(): bool
102
    {
103
        return $this->active;
104
    }
105
106
    public function setActive(bool $active): self
107
    {
108
        $this->active = $active;
109
110
        return $this;
111
    }
112
}
113