Passed
Push — master ( 9d9530...9d60e1 )
by G
07:54
created

ChannelDeposit   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 84
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setProductVariant() 0 3 1
A getChannelCode() 0 3 1
A __toString() 0 3 1
A getProductVariant() 0 3 1
A getId() 0 3 1
A getPrice() 0 3 1
A setPrice() 0 3 1
A setChannelCode() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewebe\SyliusProductDepositPlugin\Entity;
6
7
/**
8
 * Entity that stores deposit for product variants
9
 */
10
class ChannelDeposit implements ChannelDepositInterface
11
{
12
    /**
13
     * @var int
14
     */
15
    private $id;
16
17
    /**
18
     * @var int
19
     */
20
    private $price;
21
22
    /**
23
     * @var string
24
     */
25
    private $channelCode;
26
27
    /**
28
     * @var ProductVariantInterface|null
29
     */
30
    private $productVariant;
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function __toString(): string
36
    {
37
        return (string) $this->getPrice();
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getId()
44
    {
45
        return $this->id;
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getPrice(): ?int
52
    {
53
        return $this->price;
54
    }
55
56
    /**
57
     * @param int $price
58
     */
59
    public function setPrice(int $price): void
60
    {
61
        $this->price = $price;
62
    }
63
64
    /**
65
     * @return ProductVariantInterface|null
66
     */
67
    public function getProductVariant(): ?ProductVariantInterface
68
    {
69
        return $this->productVariant;
70
    }
71
72
    /**
73
     * @param ProductVariantInterface|null $productVariants
74
     */
75
    public function setProductVariant(?ProductVariantInterface $productVariants): void
76
    {
77
        $this->productVariant = $productVariants;
78
    }
79
80
    /**
81
     * @return string|null
82
     */
83
    public function getChannelCode(): ?string
84
    {
85
        return $this->channelCode;
86
    }
87
88
    /**
89
     * @param string $channelCode
90
     */
91
    public function setChannelCode(string $channelCode): void
92
    {
93
        $this->channelCode = $channelCode;
94
    }
95
}
96