Completed
Branch master (734dbe)
by G
12:13
created

ChannelDeposit   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Importance

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

8 Methods

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