Completed
Push — master ( a026a7...7ff053 )
by Kamil
21s
created

ChannelPricing::getChannelCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Component\Core\Model;
13
14
/**
15
 * @author Mateusz Zalewski <[email protected]>
16
 * @author Gorka Laucirica <[email protected]>
17
 */
18
class ChannelPricing implements ChannelPricingInterface
19
{
20
    /**
21
     * @var int
22
     */
23
    protected $id;
24
25
    /**
26
     * @var string
27
     */
28
    protected $channelCode;
29
30
    /**
31
     * @var ProductVariantInterface
32
     */
33
    protected $productVariant;
34
35
    /**
36
     * @var int
37
     */
38
    protected $price;
39
40
    /**
41
     * @var int
42
     */
43
    protected $originalPrice;
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    function __toString()
0 ignored issues
show
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for __toString.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
49
    {
50
        return (string) $this->getPrice();
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getId()
57
    {
58
        return $this->id;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function getChannelCode()
65
    {
66
        return $this->channelCode;
67
    }
68
69
    /**
70
     * {@inheritdoc}
71
     */
72
    public function setChannelCode($channelCode)
73
    {
74
        $this->channelCode = $channelCode;
75
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80
    public function getProductVariant()
81
    {
82
        return $this->productVariant;
83
    }
84
85
    /**
86
     * {@inheritdoc}
87
     */
88
    public function setProductVariant(ProductVariantInterface $productVariant = null)
89
    {
90
        $this->productVariant = $productVariant;
91
    }
92
93
    /**
94
     * {@inheritdoc}
95
     */
96
    public function getPrice()
97
    {
98
        return $this->price;
99
    }
100
101
    /**
102
     * {@inheritdoc}
103
     */
104
    public function setPrice($price)
105
    {
106
        $this->price = $price;
107
    }
108
109
    /**
110
     * {@inheritdoc}
111
     */
112
    public function getOriginalPrice()
113
    {
114
        return $this->originalPrice;
115
    }
116
117
    /**
118
     * {@inheritdoc}
119
     */
120
    public function setOriginalPrice($originalPrice)
121
    {
122
        $this->originalPrice = $originalPrice;
123
    }
124
125
    /**
126
     * {@inheritdoc}
127
     */
128
    public function isPriceReduced()
129
    {
130
        return $this->originalPrice > $this->price;
131
    }
132
}
133