1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
4
|
|
|
|
5
|
|
|
use Symfony\Component\Serializer\Attribute\Groups; |
|
|
|
|
6
|
|
|
|
7
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
12
|
|
|
use ControleOnline\Listener\LogListener; |
|
|
|
|
13
|
|
|
use ControleOnline\Repository\DocumentTypeRepository; |
14
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
15
|
|
|
|
16
|
|
|
#[ApiResource( |
17
|
|
|
operations: [ |
18
|
|
|
new Get(security: 'is_granted(\'ROLE_CLIENT\')'), |
19
|
|
|
new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')') |
20
|
|
|
], |
21
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
22
|
|
|
normalizationContext: ['groups' => ['document_type:read']], |
23
|
|
|
denormalizationContext: ['groups' => ['document_type:write']] |
24
|
|
|
)] |
25
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['peopleType' => 'exact'])] |
26
|
|
|
#[ORM\Table(name: 'document_type')] |
27
|
|
|
#[ORM\EntityListeners([LogListener::class])] |
28
|
|
|
#[ORM\Entity(repositoryClass: DocumentTypeRepository::class)] |
29
|
|
|
class DocumentType |
30
|
|
|
{ |
31
|
|
|
#[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
32
|
|
|
#[ORM\Id] |
33
|
|
|
#[ORM\GeneratedValue(strategy: 'IDENTITY')] |
34
|
|
|
private int $id = 0; |
35
|
|
|
|
36
|
|
|
#[ORM\Column(name: 'document_type', type: 'string', length: 50, nullable: false)] |
37
|
|
|
#[Groups(['people:read', 'document:read', 'document_type:read', 'carrier:read'])] |
38
|
|
|
private string $documentType; |
39
|
|
|
|
40
|
|
|
#[ORM\Column(name: 'people_type', type: 'string', length: 1, nullable: false)] |
41
|
|
|
#[Groups(['people:read', 'document:read', 'document_type:read'])] |
42
|
|
|
private string $peopleType; |
43
|
|
|
|
44
|
|
|
public function getId(): int |
45
|
|
|
{ |
46
|
|
|
return $this->id; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function setDocumentType(string $documentType): self |
50
|
|
|
{ |
51
|
|
|
$this->documentType = $documentType; |
52
|
|
|
return $this; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getDocumentType(): string |
56
|
|
|
{ |
57
|
|
|
return $this->documentType; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function setPeopleType(string $peopleType): self |
61
|
|
|
{ |
62
|
|
|
$this->peopleType = $peopleType; |
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getPeopleType(): string |
67
|
|
|
{ |
68
|
|
|
return $this->peopleType; |
69
|
|
|
} |
70
|
|
|
} |
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