WishlistProduct::setWishlist()   A
last analyzed

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 * This file was created by developers working at BitBag
5
 * Do you need more information about us and what we do? Visit our https://bitbag.io website!
6
 * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
7
*/
8
9
declare(strict_types=1);
10
11
namespace BitBag\SyliusWishlistPlugin\Entity;
12
13
use Sylius\Component\Core\Model\ProductInterface;
14
use Sylius\Component\Core\Model\ProductVariantInterface;
15
16
class WishlistProduct implements WishlistProductInterface
17
{
18
    protected ?int $id;
19
20
    protected WishlistInterface $wishlist;
21
22
    protected ?ProductInterface $product = null;
23
24
    protected ?ProductVariantInterface $variant = null;
25
26
    protected int $quantity = 0;
27
28
    public function __construct()
29
    {
30
        $this->id = null;
31
    }
32
33
    public function getId(): ?int
34
    {
35
        return $this->id;
36
    }
37
38
    public function getWishlist(): WishlistInterface
39
    {
40
        return $this->wishlist;
41
    }
42
43
    public function setWishlist(WishlistInterface $wishlist): void
44
    {
45
        $this->wishlist = $wishlist;
46
    }
47
48
    public function getProduct(): ProductInterface
49
    {
50
        /** @var ProductInterface $product */
51
        $product = $this->product;
52
53
        return $product;
54
    }
55
56
    public function setProduct(ProductInterface $product): void
57
    {
58
        $this->product = $product;
59
    }
60
61
    public function getVariant(): ?ProductVariantInterface
62
    {
63
        return $this->variant;
64
    }
65
66
    public function setVariant(?ProductVariantInterface $variant): void
67
    {
68
        $this->variant = $variant;
69
    }
70
71
    public function getQuantity(): int
72
    {
73
        return $this->quantity;
74
    }
75
76
    public function setQuantity(int $quantity): void
77
    {
78
        $this->quantity = $quantity;
79
    }
80
}
81