1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
|
13
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
14
|
|
|
use App\Controller\GetActionByPeopleAction; |
|
|
|
|
15
|
|
|
use App\Controller\GetMenuByPeopleAction; |
|
|
|
|
16
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
17
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
|
18
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
19
|
|
|
use App\Filter\OrderEntityFilter; |
|
|
|
|
20
|
|
|
use ControleOnline\Entity\Order; |
|
|
|
|
21
|
|
|
use stdClass; |
22
|
|
|
|
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Routes |
26
|
|
|
* |
27
|
|
|
* @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class}) |
28
|
|
|
* @ORM\Table(name="routes", uniqueConstraints={@ORM\UniqueConstraint(name="route", columns={"route"})}, indexes={@ORM\Index(name="module_id", columns={"module_id"})}) |
29
|
|
|
* @ORM\Entity (repositoryClass="ControleOnline\Repository\RouteRepository") |
30
|
|
|
* @ORM\Entity |
31
|
|
|
*/ |
32
|
|
|
|
33
|
|
|
#[ApiResource( |
34
|
|
|
operations: [ |
35
|
|
|
new Get(security: 'is_granted(\'ROLE_ADMIN\') or (is_granted(\'ROLE_CLIENT\'))'), |
36
|
|
|
new Put( |
37
|
|
|
security: 'is_granted(\'ROLE_CLIENT\')', |
38
|
|
|
denormalizationContext: ['groups' => ['route_write']] |
39
|
|
|
), |
40
|
|
|
new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
41
|
|
|
new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')'), |
42
|
|
|
new Post(security: 'is_granted(\'ROLE_CLIENT\')'), |
43
|
|
|
], |
44
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
45
|
|
|
normalizationContext: ['groups' => ['route_read']], |
46
|
|
|
denormalizationContext: ['groups' => ['route_write']] |
47
|
|
|
)] |
48
|
|
|
|
49
|
|
|
class Routes |
50
|
|
|
{ |
51
|
|
|
/** |
52
|
|
|
* @var int |
53
|
|
|
* |
54
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false) |
55
|
|
|
* @ORM\Id |
56
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
57
|
|
|
* @Groups({"menu_read","route_read"}) |
58
|
|
|
*/ |
59
|
|
|
private $id; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var string |
63
|
|
|
* |
64
|
|
|
* @ORM\Column(name="route", type="string", length=50, nullable=false) |
65
|
|
|
* @Groups({"menu_read","route_read"}) |
66
|
|
|
*/ |
67
|
|
|
private $route; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var \Module |
|
|
|
|
71
|
|
|
* |
72
|
|
|
* @ORM\ManyToOne(targetEntity="Module") |
73
|
|
|
* @ORM\JoinColumns({ |
74
|
|
|
* @ORM\JoinColumn(name="module_id", referencedColumnName="id") |
75
|
|
|
* }) |
76
|
|
|
* @Groups({"menu_read","route_read"}) |
77
|
|
|
*/ |
78
|
|
|
private $module; |
79
|
|
|
|
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Get the value of id |
83
|
|
|
*/ |
84
|
|
|
public function getId() |
85
|
|
|
{ |
86
|
|
|
return $this->id; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Set the value of id |
91
|
|
|
*/ |
92
|
|
|
public function setId(int $id): self |
93
|
|
|
{ |
94
|
|
|
$this->id = $id; |
95
|
|
|
|
96
|
|
|
return $this; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Get the value of route |
101
|
|
|
*/ |
102
|
|
|
public function getRoute() |
103
|
|
|
{ |
104
|
|
|
return $this->route; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Set the value of route |
109
|
|
|
*/ |
110
|
|
|
public function setRoute($route): self |
111
|
|
|
{ |
112
|
|
|
$this->route = $route; |
113
|
|
|
|
114
|
|
|
return $this; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Get the value of module |
119
|
|
|
*/ |
120
|
|
|
public function getModule() |
121
|
|
|
{ |
122
|
|
|
return $this->module; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Set the value of module |
127
|
|
|
*/ |
128
|
|
|
public function setModule($module): self |
129
|
|
|
{ |
130
|
|
|
$this->module = $module; |
131
|
|
|
|
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
} |
135
|
|
|
|
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