commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductSelectionAssignmentModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $product;
29
35
41
47
48
52 public function __construct(
57 ) {
58 $this->product = $product;
59 $this->productSelection = $productSelection;
60 $this->variantSelection = $variantSelection;
61 $this->variantExclusion = $variantExclusion;
62 }
63
70 public function getProduct()
71 {
72 if (is_null($this->product)) {
74 $data = $this->raw(self::FIELD_PRODUCT);
75 if (is_null($data)) {
76 return null;
77 }
78
79 $this->product = ProductReferenceModel::of($data);
80 }
81
82 return $this->product;
83 }
84
91 public function getProductSelection()
92 {
93 if (is_null($this->productSelection)) {
95 $data = $this->raw(self::FIELD_PRODUCT_SELECTION);
96 if (is_null($data)) {
97 return null;
98 }
99
100 $this->productSelection = ProductSelectionReferenceModel::of($data);
101 }
102
104 }
105
115 public function getVariantSelection()
116 {
117 if (is_null($this->variantSelection)) {
119 $data = $this->raw(self::FIELD_VARIANT_SELECTION);
120 if (is_null($data)) {
121 return null;
122 }
124 $this->variantSelection = $className::of($data);
125 }
126
128 }
129
139 public function getVariantExclusion()
140 {
141 if (is_null($this->variantExclusion)) {
143 $data = $this->raw(self::FIELD_VARIANT_EXCLUSION);
144 if (is_null($data)) {
145 return null;
146 }
147
148 $this->variantExclusion = ProductVariantExclusionModel::of($data);
149 }
150
152 }
153
154
158 public function setProduct(?ProductReference $product): void
159 {
160 $this->product = $product;
161 }
162
167 {
168 $this->productSelection = $productSelection;
169 }
170
175 {
176 $this->variantSelection = $variantSelection;
177 }
178
183 {
184 $this->variantExclusion = $variantExclusion;
185 }
186}
__construct(?ProductReference $product=null, ?ProductSelectionReference $productSelection=null, ?ProductVariantSelection $variantSelection=null, ?ProductVariantExclusion $variantExclusion=null)