Passed
Pull Request — master (#6116)
by
unknown
11:38
created

Plugin::setActive()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
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 Doctrine\ORM\Mapping as ORM;
11
use Symfony\Component\Serializer\Annotation\Groups;
12
13
#[ApiResource]
14
#[ORM\Entity]
15
#[ORM\Table(name: 'plugin')]
16
class Plugin
17
{
18
    #[ORM\Id]
19
    #[ORM\GeneratedValue]
20
    #[ORM\Column(type: 'integer')]
21
    private ?int $id = null;
22
23
    #[ORM\Column(type: 'string', length: 255, unique: true)]
24
    #[Groups(['plugin:read', 'plugin:write'])]
25
    private string $title;
26
27
    #[ORM\Column(type: 'boolean')]
28
    #[Groups(['plugin:read', 'plugin:write'])]
29
    private bool $installed = false;
30
31
    #[ORM\Column(type: 'boolean')]
32
    #[Groups(['plugin:read', 'plugin:write'])]
33
    private bool $active = false;
34
35
    #[ORM\Column(type: 'string', length: 20)]
36
    #[Groups(['plugin:read', 'plugin:write'])]
37
    private string $version;
38
39
    #[ORM\Column(type: 'integer')]
40
    #[Groups(['plugin:read', 'plugin:write'])]
41
    private int $accessUrlId;
42
43
    #[ORM\Column(type: 'json', nullable: true)]
44
    #[Groups(['plugin:read', 'plugin:write'])]
45
    private ?array $configuration = [];
46
47
    #[ORM\Column(type: 'string', length: 20, options: ["default" => "third_party"])]
48
    #[Groups(['plugin:read', 'plugin:write'])]
49
    private string $source = 'third_party';
50
51
    public function getId(): ?int
52
    {
53
        return $this->id;
54
    }
55
56
    public function getTitle(): string
57
    {
58
        return $this->title;
59
    }
60
61
    public function setTitle(string $title): self
62
    {
63
        $this->title = $title;
64
        return $this;
65
    }
66
67
    public function isInstalled(): bool
68
    {
69
        return $this->installed;
70
    }
71
72
    public function setInstalled(bool $installed): self
73
    {
74
        $this->installed = $installed;
75
        return $this;
76
    }
77
78
    public function isActive(): bool
79
    {
80
        return $this->active;
81
    }
82
83
    public function setActive(bool $active): self
84
    {
85
        $this->active = $active;
86
        return $this;
87
    }
88
89
    public function getVersion(): string
90
    {
91
        return $this->version;
92
    }
93
94
    public function setVersion(string $version): self
95
    {
96
        $this->version = $version;
97
        return $this;
98
    }
99
100
    public function getAccessUrlId(): int
101
    {
102
        return $this->accessUrlId;
103
    }
104
105
    public function setAccessUrlId(int $accessUrlId): self
106
    {
107
        $this->accessUrlId = $accessUrlId;
108
        return $this;
109
    }
110
111
    public function getConfiguration(): ?array
112
    {
113
        return $this->configuration;
114
    }
115
116
    public function setConfiguration(?array $configuration): self
117
    {
118
        $this->configuration = $configuration;
119
        return $this;
120
    }
121
122
    public function getSource(): string
123
    {
124
        return $this->source;
125
    }
126
127
    public function setSource(string $source): self
128
    {
129
        $this->source = $source;
130
        return $this;
131
    }
132
}
133