Completed
Pull Request — master (#3)
by Joachim
04:44 queued 14s
created

StockMovement::getPrice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusStockMovementPlugin\Model;
6
7
use Sylius\Component\Core\Model\ProductVariantInterface;
8
use Sylius\Component\Resource\Model\TimestampableTrait;
9
10
class StockMovement implements StockMovementInterface
11
{
12
    use TimestampableTrait;
13
14
    /** @var int */
15
    protected $id;
16
17
    /** @var int */
18
    protected $quantity;
19
20
    /** @var ProductVariantInterface|null */
21
    protected $variant;
22
23
    /** @var string|null */
24
    protected $variantCode;
25
26
    /** @var string|null */
27
    protected $reference;
28
29
    public function getId(): ?int
30
    {
31
        return $this->id;
32
    }
33
34
    public function getQuantity(): ?int
35
    {
36
        return $this->quantity;
37
    }
38
39
    public function setQuantity(int $quantity): void
40
    {
41
        $this->quantity = $quantity;
42
    }
43
44
    public function getVariant(): ?ProductVariantInterface
45
    {
46
        return $this->variant;
47
    }
48
49
    public function setVariant(?ProductVariantInterface $variant): void
50
    {
51
        $this->variant = $variant;
52
53
        if (null !== $variant) {
54
            $this->variantCode = (string) $variant->getCode();
55
        }
56
    }
57
58
    public function getVariantCode(): ?string
59
    {
60
        return $this->variantCode;
61
    }
62
63
    public function setVariantCode(?string $variantCode): void
64
    {
65
        $this->variantCode = $variantCode;
66
    }
67
68
    public function getReference(): ?string
69
    {
70
        return $this->reference;
71
    }
72
73
    public function setReference(?string $reference): void
74
    {
75
        $this->reference = $reference;
76
    }
77
}
78