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