Passed
Push — master ( 69edb6...1e9864 )
by Luiz Kim
02:26
created

OrderInvoice::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
use ApiPlatform\Metadata\GetCollection;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\GetCollection was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use ApiPlatform\Metadata\Get;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Get was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use ApiPlatform\Metadata\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiResource was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use ApiPlatform\Metadata\ApiProperty;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiProperty was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Doctrine\Orm\Filter\SearchFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use ApiPlatform\Metadata\ApiFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Symfony\Component\Serializer\Annotation\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Annotation\Groups was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Doctrine\Common\Collections\ArrayCollection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\Invoice was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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