|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use ApiPlatform\Metadata\Link; |
|
|
|
|
|
|
6
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
|
|
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
|
|
12
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* @ORM\Table (name="contract_people") |
|
15
|
|
|
* @ORM\Entity |
|
16
|
|
|
* @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class}) |
|
17
|
|
|
*/ |
|
18
|
|
|
#[ApiResource(operations: [new Get(security: 'is_granted(\'ROLE_CLIENT\')')], formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']])] |
|
19
|
|
|
#[ApiResource(uriTemplate: '/people/{id}/contracts_peoples.{_format}', uriVariables: ['id' => new Link(fromClass: \ControleOnline\Entity\People::class, identifiers: ['id'], toProperty: 'people')], status: 200, operations: [new GetCollection()])] |
|
20
|
|
|
class ContractPeople |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @ORM\Column(type="integer", nullable=false) |
|
24
|
|
|
* @ORM\Id |
|
25
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
|
26
|
|
|
* @Groups("contract_people:read") |
|
27
|
|
|
*/ |
|
28
|
|
|
private $id; |
|
29
|
|
|
/** |
|
30
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Contract") |
|
31
|
|
|
* @ORM\JoinColumns({ |
|
32
|
|
|
* @ORM\JoinColumn(name="contract_id", referencedColumnName="id", nullable=false) |
|
33
|
|
|
* }) |
|
34
|
|
|
* @Groups("contract_people:read") |
|
35
|
|
|
*/ |
|
36
|
|
|
private $contract; |
|
37
|
|
|
/** |
|
38
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People", inversedBy="contractsPeople") |
|
39
|
|
|
* @ORM\JoinColumns({ |
|
40
|
|
|
* @ORM\JoinColumn(name="people_id", referencedColumnName="id", nullable=false) |
|
41
|
|
|
* }) |
|
42
|
|
|
* @Groups("contract_people:read") |
|
43
|
|
|
*/ |
|
44
|
|
|
private $people; |
|
45
|
|
|
/** |
|
46
|
|
|
* @ORM\Column(name="people_type", type="string", columnDefinition="enum('Beneficiary', 'Witness', 'Payer', 'Provider')") |
|
47
|
|
|
* @Groups("contract_people:read") |
|
48
|
|
|
*/ |
|
49
|
|
|
private $people_type; |
|
50
|
|
|
/** |
|
51
|
|
|
* @ORM\Column(name="contract_percentage", type="float", nullable=true) |
|
52
|
|
|
* @Groups("contract_people:read") |
|
53
|
|
|
*/ |
|
54
|
|
|
private $contract_percentage; |
|
55
|
|
|
public function getId() : int |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->id; |
|
58
|
|
|
} |
|
59
|
|
|
public function getContract() : Contract |
|
60
|
|
|
{ |
|
61
|
|
|
return $this->contract; |
|
62
|
|
|
} |
|
63
|
|
|
public function setContract(Contract $contract) : ContractPeople |
|
64
|
|
|
{ |
|
65
|
|
|
$this->contract = $contract; |
|
66
|
|
|
return $this; |
|
67
|
|
|
} |
|
68
|
|
|
public function getPeople() : People |
|
|
|
|
|
|
69
|
|
|
{ |
|
70
|
|
|
return $this->people; |
|
71
|
|
|
} |
|
72
|
|
|
public function setPeople(People $people) : ContractPeople |
|
73
|
|
|
{ |
|
74
|
|
|
$this->people = $people; |
|
75
|
|
|
return $this; |
|
76
|
|
|
} |
|
77
|
|
|
public function getPeopleType() : string |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->people_type; |
|
80
|
|
|
} |
|
81
|
|
|
public function setPeopleType(string $people_type) : ContractPeople |
|
82
|
|
|
{ |
|
83
|
|
|
$this->people_type = $people_type; |
|
84
|
|
|
return $this; |
|
85
|
|
|
} |
|
86
|
|
|
public function getContractPercentage() : float |
|
87
|
|
|
{ |
|
88
|
|
|
return $this->contract_percentage ?: 0; |
|
89
|
|
|
} |
|
90
|
|
|
public function setContractPercentage(float $contract_percentage) : ContractPeople |
|
91
|
|
|
{ |
|
92
|
|
|
$this->contract_percentage = $contract_percentage; |
|
93
|
|
|
return $this; |
|
94
|
|
|
} |
|
95
|
|
|
} |
|
96
|
|
|
|
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