-
Notifications
You must be signed in to change notification settings - Fork 14
/
CartItemOptionValue.php
66 lines (52 loc) · 1.33 KB
/
CartItemOptionValue.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
namespace inklabs\kommerce\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
class CartItemOptionValue implements IdEntityInterface
{
use TimeTrait, IdTrait;
/** @var OptionValue|null */
protected $optionValue;
/** @var CartItem|null */
protected $cartItem;
public function __construct()
{
$this->setId();
$this->setCreated();
}
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
// TODO: Implement loadValidatorMetadata() method.
}
public function __clone()
{
$this->setId();
}
public function getOptionValue(): ?OptionValue
{
return $this->optionValue;
}
public function setOptionValue(OptionValue $optionValue)
{
$this->optionValue = $optionValue;
}
public function getSku(): string
{
return $this->optionValue->getSku();
}
public function getPrice(int $quantity = 1): Price
{
return $this->optionValue->getPrice($quantity);
}
public function getShippingWeight(): int
{
return $this->optionValue->getShippingWeight();
}
public function getCartItem(): ?CartItem
{
return $this->cartItem;
}
public function setCartItem(CartItem $cartItem)
{
$this->cartItem = $cartItem;
}
}