|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Serializer\Attribute\Groups; |
|
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
|
|
13
|
|
|
use ControleOnline\Listener\LogListener; |
|
14
|
|
|
use ControleOnline\Repository\ModuleRepository; |
|
15
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
#[ApiResource( |
|
18
|
|
|
operations: [ |
|
19
|
|
|
new Get(security: 'is_granted(\'ROLE_ADMIN\') or (is_granted(\'ROLE_CLIENT\'))'), |
|
20
|
|
|
new Put( |
|
21
|
|
|
security: 'is_granted(\'ROLE_CLIENT\')', |
|
22
|
|
|
denormalizationContext: ['groups' => ['module:write']] |
|
23
|
|
|
), |
|
24
|
|
|
new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
|
25
|
|
|
new Post(security: 'is_granted(\'ROLE_CLIENT\')'), |
|
26
|
|
|
new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')') |
|
27
|
|
|
], |
|
28
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
29
|
|
|
normalizationContext: ['groups' => ['module:read']], |
|
30
|
|
|
denormalizationContext: ['groups' => ['module:write']] |
|
31
|
|
|
)] |
|
32
|
|
|
#[ORM\Table(name: 'module')] |
|
33
|
|
|
#[ORM\UniqueConstraint(name: 'UX_MODULE_NAME', columns: ['name'])] |
|
34
|
|
|
#[ORM\EntityListeners([LogListener::class])] |
|
35
|
|
|
#[ORM\Entity(repositoryClass: ModuleRepository::class)] |
|
36
|
|
|
class Module |
|
37
|
|
|
{ |
|
38
|
|
|
#[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
|
39
|
|
|
#[ORM\Id] |
|
40
|
|
|
#[ORM\GeneratedValue(strategy: 'IDENTITY')] |
|
41
|
|
|
#[Groups(['menu:read', 'module:read'])] |
|
42
|
|
|
private $id; |
|
43
|
|
|
|
|
44
|
|
|
#[ORM\Column(name: 'name', type: 'string', length: 100, nullable: false)] |
|
45
|
|
|
#[Groups(['menu:read', 'module:read', 'module:write'])] |
|
46
|
|
|
private $name; |
|
47
|
|
|
|
|
48
|
|
|
#[ORM\Column(name: 'color', type: 'string', length: 50, nullable: false, options: ['default' => "'\$primary'"])] |
|
49
|
|
|
#[Groups(['menu:read', 'module:read', 'module:write'])] |
|
50
|
|
|
private $color = '$primary'; |
|
51
|
|
|
|
|
52
|
|
|
#[ORM\Column(name: 'icon', type: 'string', length: 50, nullable: false)] |
|
53
|
|
|
#[Groups(['menu:read', 'module:read', 'module:write'])] |
|
54
|
|
|
private $icon; |
|
55
|
|
|
|
|
56
|
|
|
#[ORM\Column(name: 'description', type: 'string', length: 255, nullable: true, options: ['default' => 'NULL'])] |
|
57
|
|
|
#[Groups(['menu:read', 'module:read', 'module:write'])] |
|
58
|
|
|
private $description = null; |
|
59
|
|
|
|
|
60
|
|
|
public function getId() |
|
61
|
|
|
{ |
|
62
|
|
|
return $this->id; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getName(): string |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->name; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function setName(string $name): self |
|
71
|
|
|
{ |
|
72
|
|
|
$this->name = $name; |
|
73
|
|
|
return $this; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function getColor(): string |
|
77
|
|
|
{ |
|
78
|
|
|
return $this->color; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
public function setColor(string $color): self |
|
82
|
|
|
{ |
|
83
|
|
|
$this->color = $color; |
|
84
|
|
|
return $this; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function getIcon(): string |
|
88
|
|
|
{ |
|
89
|
|
|
return $this->icon; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function setIcon(string $icon): self |
|
93
|
|
|
{ |
|
94
|
|
|
$this->icon = $icon; |
|
95
|
|
|
return $this; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function getDescription(): ?string |
|
99
|
|
|
{ |
|
100
|
|
|
return $this->description; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function setDescription(?string $description): self |
|
104
|
|
|
{ |
|
105
|
|
|
$this->description = $description; |
|
106
|
|
|
return $this; |
|
107
|
|
|
} |
|
108
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths