commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductSelectionAssignmentBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $product;
30
35 private $productSelection;
36
41 private $variantSelection;
42
47 private $variantExclusion;
48
55 public function getProduct()
56 {
57 return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;
58 }
59
66 public function getProductSelection()
67 {
68 return $this->productSelection instanceof ProductSelectionReferenceBuilder ? $this->productSelection->build() : $this->productSelection;
69 }
70
80 public function getVariantSelection()
81 {
82 return $this->variantSelection instanceof ProductVariantSelectionBuilder ? $this->variantSelection->build() : $this->variantSelection;
83 }
84
94 public function getVariantExclusion()
95 {
96 return $this->variantExclusion instanceof ProductVariantExclusionBuilder ? $this->variantExclusion->build() : $this->variantExclusion;
97 }
98
103 public function withProduct(?ProductReference $product)
104 {
105 $this->product = $product;
106
107 return $this;
108 }
109
114 public function withProductSelection(?ProductSelectionReference $productSelection)
115 {
116 $this->productSelection = $productSelection;
117
118 return $this;
119 }
120
125 public function withVariantSelection(?ProductVariantSelection $variantSelection)
126 {
127 $this->variantSelection = $variantSelection;
128
129 return $this;
130 }
131
136 public function withVariantExclusion(?ProductVariantExclusion $variantExclusion)
137 {
138 $this->variantExclusion = $variantExclusion;
139
140 return $this;
141 }
142
148 {
149 $this->product = $product;
150
151 return $this;
152 }
153
159 {
160 $this->productSelection = $productSelection;
161
162 return $this;
163 }
164
170 {
171 $this->variantSelection = $variantSelection;
172
173 return $this;
174 }
175
181 {
182 $this->variantExclusion = $variantExclusion;
183
184 return $this;
185 }
186
188 {
190 $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product,
191 $this->productSelection instanceof ProductSelectionReferenceBuilder ? $this->productSelection->build() : $this->productSelection,
192 $this->variantSelection instanceof ProductVariantSelectionBuilder ? $this->variantSelection->build() : $this->variantSelection,
193 $this->variantExclusion instanceof ProductVariantExclusionBuilder ? $this->variantExclusion->build() : $this->variantExclusion
194 );
195 }
196
197 public static function of(): ProductSelectionAssignmentBuilder
198 {
199 return new self();
200 }
201}