-
Notifications
You must be signed in to change notification settings - Fork 14
/
OrderItemOptionProduct.php
73 lines (57 loc) · 1.55 KB
/
OrderItemOptionProduct.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
67
68
69
70
71
72
73
<?php
namespace inklabs\kommerce\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
class OrderItemOptionProduct implements IdEntityInterface
{
use TimeTrait, IdTrait;
/** @var string|null */
protected $sku;
/** @var string */
protected $optionName;
/** @var string */
protected $optionProductName;
/** @var OptionProduct */
protected $optionProduct;
/** @var OrderItem */
protected $orderItem;
public function __construct()
{
$this->setId();
$this->setCreated();
}
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
// TODO: Implement loadValidatorMetadata() method.
}
public function getOptionProduct(): OptionProduct
{
return $this->optionProduct;
}
public function setOptionProduct(OptionProduct $optionProduct)
{
$this->optionProduct = $optionProduct;
$this->sku = $optionProduct->getSku();
$this->optionName = $optionProduct->getOption()->getName();
$this->optionProductName = $optionProduct->getName();
}
public function getSku(): ?string
{
return $this->sku;
}
public function getOptionName(): string
{
return $this->optionName;
}
public function getOptionProductName(): string
{
return $this->optionProductName;
}
public function getOrderItem(): OrderItem
{
return $this->orderItem;
}
public function setOrderItem(OrderItem $orderItem)
{
$this->orderItem = $orderItem;
}
}