Completed
Push — master ( c3c281...ab94e9 )
by Gabriel
03:37
created

Price::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Waredesk\Models\Product\Variant;
4
5
use DateTime;
6
use JsonSerializable;
7
8
class Price implements JsonSerializable
9
{
10
    private $id;
11
    private $price_list_id;
12
    private $currency;
13
    private $price;
14
    private $creation_datetime;
15
    private $modification_datetime;
16
17
    public function getId(): ?int
18
    {
19
        return $this->id;
20
    }
21
22
    public function setId(int $id)
23
    {
24
        $this->id = $id;
25
    }
26
27
    public function getPriceListId(): ?int
28
    {
29
        return $this->price_list_id;
30
    }
31
32
    public function setPriceListId(int $price_list_id)
33
    {
34
        $this->price_list_id = $price_list_id;
35
    }
36
37
    public function getCurrency(): ?string
38
    {
39
        return $this->currency;
40
    }
41
42
    public function setCurrency(string $currency)
43
    {
44
        $this->currency = $currency;
45
    }
46
47
    public function getPrice(): ?int
48
    {
49
        return $this->price;
50
    }
51
52
    public function setPrice(int $price)
53
    {
54
        $this->price = $price;
55
    }
56
57
    public function getCreationDatetime(): ?DateTime
58
    {
59
        return $this->creation_datetime;
60
    }
61
62
    public function setCreationDatetime(DateTime $creation_datetime)
63
    {
64
        $this->creation_datetime = $creation_datetime;
65
    }
66
67
    public function getModificationDatetime(): ?DateTime
68
    {
69
        return $this->modification_datetime;
70
    }
71
72
    public function setModificationDatetime(DateTime $modification_datetime)
73
    {
74
        $this->modification_datetime = $modification_datetime;
75
    }
76
77
    public function jsonSerialize()
78
    {
79
        return [
80
            'price_list_id' => $this->getPriceListId(),
81
            'currency' => $this->getCurrency(),
82
            'price' => $this->getPrice(),
83
        ];
84
    }
85
}
86