ProductVariantTrait::getBasePriceUnit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecocode\SyliusBasePricePlugin\Entity\Product;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * Trait ProductVariantTrait
11
 * @package Ecocode\SyliusBasePricePlugin\Entity\Product
12
 */
13
trait ProductVariantTrait
14
{
15
    /**
16
     * @ORM\Column(name="base_price_unit", type="string", length=8, nullable=true)
17
     * @param null|string
18
     */
19
    protected $basePriceUnit;
20
21
    /**
22
     * @ORM\Column(name="base_price_value", type="integer", length=8, nullable=true)
23
     * @param null|int
24
     */
25
    protected $basePriceValue;
26
27
    /**
28
     * Product variant weight,volume,length unit name
29
     *
30
     * @param string|null $basePriceUnit
31
     *
32
     * @return $this
33
     */
34
    public function setBasePriceUnit(?string $basePriceUnit)
35
    {
36
        $this->basePriceUnit = $basePriceUnit;
37
38
        return $this;
39
    }
40
41
    /**
42
     * Product variant weight or volume unit name
43
     *
44
     * @return string|null
45
     */
46
    public function getBasePriceUnit(): ?string
47
    {
48
        return $this->basePriceUnit;
49
    }
50
51
    /**
52
     * Product variant weight or volume in defined "base_price_unit" units
53
     *
54
     * @param int|null $basePriceValue
55
     *
56
     * @return $this
57
     */
58
    public function setBasePriceValue(?int $basePriceValue)
59
    {
60
        $this->basePriceValue = $basePriceValue;
61
62
        return $this;
63
    }
64
65
    /**
66
     * Product variant weight or volume in defined "base_price_unit" units
67
     *
68
     * @return int|null
69
     */
70
    public function getBasePriceValue(): ?int
71
    {
72
        return $this->basePriceValue;
73
    }
74
}
75