1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
4
|
|
|
|
5
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
6
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
|
9
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
12
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
13
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* OrderInvoice |
16
|
|
|
* |
17
|
|
|
* @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class}) |
18
|
|
|
* @ORM\Table (name="order_invoice", uniqueConstraints={@ORM\UniqueConstraint (name="order_id", columns={"order_id", "invoice_id"})}, indexes={@ORM\Index (name="invoice_id", columns={"invoice_id"})}) |
19
|
|
|
* @ORM\Entity |
20
|
|
|
*/ |
21
|
|
|
#[ApiResource(operations: [new Get(security: 'is_granted(\'ROLE_CLIENT\')'), new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')')], formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], normalizationContext: ['groups' => ['order_invoice_read']], denormalizationContext: ['groups' => ['order_invoice_write']])] |
22
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['order.id' => 'exact'])] |
23
|
|
|
class OrderInvoice |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* @var integer |
27
|
|
|
* |
28
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false) |
29
|
|
|
* @ORM\Id |
30
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
31
|
|
|
* @Groups({"order_invoice_read","order_read"}) |
32
|
|
|
*/ |
33
|
|
|
private $id; |
34
|
|
|
/** |
35
|
|
|
* @var \ControleOnline\Entity\Invoice |
|
|
|
|
36
|
|
|
* |
37
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Invoice", inversedBy="order") |
38
|
|
|
* @ORM\JoinColumns({ |
39
|
|
|
* @ORM\JoinColumn(name="invoice_id", referencedColumnName="id") |
40
|
|
|
* }) |
41
|
|
|
* @Groups({"order_invoice_read","order_read"}) |
42
|
|
|
*/ |
43
|
|
|
private $invoice; |
44
|
|
|
/** |
45
|
|
|
* @var \ControleOnline\Entity\Order |
46
|
|
|
* |
47
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Order", inversedBy="invoice") |
48
|
|
|
* @ORM\JoinColumns({ |
49
|
|
|
* @ORM\JoinColumn(name="order_id", referencedColumnName="id") |
50
|
|
|
* }) |
51
|
|
|
* @Groups({"invoice_read","order_invoice_read"}) |
52
|
|
|
*/ |
53
|
|
|
private $order; |
54
|
|
|
/** |
55
|
|
|
* @var float |
56
|
|
|
* |
57
|
|
|
* @ORM\Column(name="real_price", type="float", nullable=false) |
58
|
|
|
* @Groups({"order_invoice_read","order_read"}) |
59
|
|
|
* |
60
|
|
|
*/ |
61
|
|
|
private $realPrice = 0; |
62
|
|
|
/** |
63
|
|
|
* Get id |
64
|
|
|
* |
65
|
|
|
* @return integer |
66
|
|
|
*/ |
67
|
|
|
public function getId() |
68
|
|
|
{ |
69
|
|
|
return $this->id; |
70
|
|
|
} |
71
|
|
|
/** |
72
|
|
|
* Set invoice |
73
|
|
|
* |
74
|
|
|
* @param \ControleOnline\Entity\Invoice $invoice |
75
|
|
|
* @return OrderInvoice |
76
|
|
|
*/ |
77
|
|
|
public function setInvoice(\ControleOnline\Entity\Invoice $invoice = null) |
78
|
|
|
{ |
79
|
|
|
$this->invoice = $invoice; |
80
|
|
|
return $this; |
81
|
|
|
} |
82
|
|
|
/** |
83
|
|
|
* Get invoice |
84
|
|
|
* |
85
|
|
|
* @return \ControleOnline\Entity\Invoice |
86
|
|
|
*/ |
87
|
|
|
public function getInvoice() |
88
|
|
|
{ |
89
|
|
|
return $this->invoice; |
90
|
|
|
} |
91
|
|
|
/** |
92
|
|
|
* Set order |
93
|
|
|
* |
94
|
|
|
* @param \ControleOnline\Entity\Order $order |
95
|
|
|
* @return OrderInvoice |
96
|
|
|
*/ |
97
|
|
|
public function setOrder(\ControleOnline\Entity\Order $order = null) |
98
|
|
|
{ |
99
|
|
|
$this->order = $order; |
100
|
|
|
return $this; |
101
|
|
|
} |
102
|
|
|
/** |
103
|
|
|
* Get order |
104
|
|
|
* |
105
|
|
|
* @return \ControleOnline\Entity\Order |
106
|
|
|
*/ |
107
|
|
|
public function getOrder() |
108
|
|
|
{ |
109
|
|
|
return $this->order; |
110
|
|
|
} |
111
|
|
|
/** |
112
|
|
|
* Set realPrice |
113
|
|
|
* |
114
|
|
|
* @param float $realPrice |
115
|
|
|
* @return OrderInvoice |
116
|
|
|
*/ |
117
|
|
|
public function setRealPrice($realPrice) |
118
|
|
|
{ |
119
|
|
|
$this->realPrice = $realPrice; |
120
|
|
|
return $this; |
121
|
|
|
} |
122
|
|
|
/** |
123
|
|
|
* Get realPrice |
124
|
|
|
* |
125
|
|
|
* @return float |
126
|
|
|
*/ |
127
|
|
|
public function getRealPrice() |
128
|
|
|
{ |
129
|
|
|
return $this->realPrice; |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
|
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