1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
6
|
|
|
use ControleOnline\Entity\People; |
|
|
|
|
7
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
13
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
14
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
15
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
16
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; |
|
|
|
|
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Inventory |
20
|
|
|
* |
21
|
|
|
* @ORM\Table(name="inventory", indexes={@ORM\Index(name="people_id", columns={"people_id"})}) |
22
|
|
|
* @ORM\Entity(repositoryClass="ControleOnline\Repository\InventoryRepository") |
23
|
|
|
*/ |
24
|
|
|
#[ApiResource( |
25
|
|
|
operations: [ |
26
|
|
|
new Get(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
27
|
|
|
new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['inventory:write']]), |
28
|
|
|
new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
29
|
|
|
new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
30
|
|
|
new GetCollection(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
31
|
|
|
], |
32
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
33
|
|
|
normalizationContext: ['groups' => ['inventory:read']], |
34
|
|
|
denormalizationContext: ['groups' => ['inventory:write']] |
35
|
|
|
)] |
36
|
|
|
#[ApiFilter(OrderFilter::class, properties: ['inventory', 'type'])] |
37
|
|
|
#[ApiFilter(SearchFilter::class, properties: ['id' => 'exact', 'inventory' => 'partial', 'type' => 'exact', 'people' => 'exact'])] |
38
|
|
|
class Inventory |
39
|
|
|
{ |
40
|
|
|
/** |
41
|
|
|
* @var int |
42
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false) |
43
|
|
|
* @ORM\Id |
44
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
45
|
|
|
* @Groups({"inventory:read", "inventory:write"}) |
46
|
|
|
*/ |
47
|
|
|
private $id; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var string |
51
|
|
|
* @ORM\Column(name="inventory", type="string", length=255, nullable=false) |
52
|
|
|
* @Groups({"inventory:read", "inventory:write"}) |
53
|
|
|
*/ |
54
|
|
|
private $inventory; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var string |
58
|
|
|
* @ORM\Column(name="type", type="string", length=50, nullable=false) |
59
|
|
|
* @Groups({"inventory:read", "inventory:write"}) |
60
|
|
|
*/ |
61
|
|
|
private $type; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @var \ControleOnline\Entity\People |
65
|
|
|
* @ORM\ManyToOne(targetEntity="\ControleOnline\Entity\People") |
66
|
|
|
* @ORM\JoinColumns({ |
67
|
|
|
* @ORM\JoinColumn(name="people_id", referencedColumnName="id", nullable=false) |
68
|
|
|
* }) |
69
|
|
|
* @Groups({"inventory:read", "inventory:write"}) |
70
|
|
|
*/ |
71
|
|
|
private $people; |
72
|
|
|
|
73
|
|
|
public function getId(): ?int |
74
|
|
|
{ |
75
|
|
|
return $this->id; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function setId(int $id): self |
79
|
|
|
{ |
80
|
|
|
$this->id = $id; |
81
|
|
|
return $this; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function getInventory(): ?string |
85
|
|
|
{ |
86
|
|
|
return $this->inventory; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function setInventory(string $inventory): self |
90
|
|
|
{ |
91
|
|
|
$this->inventory = $inventory; |
92
|
|
|
return $this; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function getType(): ?string |
96
|
|
|
{ |
97
|
|
|
return $this->type; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
public function setType(string $type): self |
101
|
|
|
{ |
102
|
|
|
$this->type = $type; |
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function getPeople(): ?People |
107
|
|
|
{ |
108
|
|
|
return $this->people; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
public function setPeople(People $people): self |
112
|
|
|
{ |
113
|
|
|
$this->people = $people; |
114
|
|
|
return $this; |
115
|
|
|
} |
116
|
|
|
} |
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