commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
ProductSelection
ProductSelectionAssignmentBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSelection
;
10
11
use
Commercetools\Api\Models\Product\ProductReference
;
12
use
Commercetools\Api\Models\Product\ProductReferenceBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
ProductSelectionAssignmentBuilder
implements
Builder
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
147
public
function
withProductBuilder
(?
ProductReferenceBuilder
$product)
148
{
149
$this->product = $product;
150
151
return
$this;
152
}
153
158
public
function
withProductSelectionBuilder
(?
ProductSelectionReferenceBuilder
$productSelection)
159
{
160
$this->productSelection = $productSelection;
161
162
return
$this;
163
}
164
169
public
function
withVariantSelectionBuilder
(?
ProductVariantSelectionBuilder
$variantSelection)
170
{
171
$this->variantSelection = $variantSelection;
172
173
return
$this;
174
}
175
180
public
function
withVariantExclusionBuilder
(?
ProductVariantExclusionBuilder
$variantExclusion)
181
{
182
$this->variantExclusion = $variantExclusion;
183
184
return
$this;
185
}
186
187
public
function
build
():
ProductSelectionAssignment
188
{
189
return
new
ProductSelectionAssignmentModel
(
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
}
Commercetools\Api\Models\Product\ProductReferenceBuilder
Definition
ProductReferenceBuilder.php:24
Commercetools\Api\Models\Product\ProductReferenceBuilder\build
build()
Definition
ProductReferenceBuilder.php:92
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder
Definition
ProductSelectionAssignmentBuilder.php:24
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\of
static of()
Definition
ProductSelectionAssignmentBuilder.php:197
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withVariantSelectionBuilder
withVariantSelectionBuilder(?ProductVariantSelectionBuilder $variantSelection)
Definition
ProductSelectionAssignmentBuilder.php:169
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withVariantExclusion
withVariantExclusion(?ProductVariantExclusion $variantExclusion)
Definition
ProductSelectionAssignmentBuilder.php:136
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withProductBuilder
withProductBuilder(?ProductReferenceBuilder $product)
Definition
ProductSelectionAssignmentBuilder.php:147
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withProductSelectionBuilder
withProductSelectionBuilder(?ProductSelectionReferenceBuilder $productSelection)
Definition
ProductSelectionAssignmentBuilder.php:158
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withVariantExclusionBuilder
withVariantExclusionBuilder(?ProductVariantExclusionBuilder $variantExclusion)
Definition
ProductSelectionAssignmentBuilder.php:180
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\getProductSelection
getProductSelection()
Definition
ProductSelectionAssignmentBuilder.php:66
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\getVariantExclusion
getVariantExclusion()
Definition
ProductSelectionAssignmentBuilder.php:94
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\getProduct
getProduct()
Definition
ProductSelectionAssignmentBuilder.php:55
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\build
build()
Definition
ProductSelectionAssignmentBuilder.php:187
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withProductSelection
withProductSelection(?ProductSelectionReference $productSelection)
Definition
ProductSelectionAssignmentBuilder.php:114
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withProduct
withProduct(?ProductReference $product)
Definition
ProductSelectionAssignmentBuilder.php:103
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\getVariantSelection
getVariantSelection()
Definition
ProductSelectionAssignmentBuilder.php:80
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentBuilder\withVariantSelection
withVariantSelection(?ProductVariantSelection $variantSelection)
Definition
ProductSelectionAssignmentBuilder.php:125
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignmentModel
Definition
ProductSelectionAssignmentModel.php:23
Commercetools\Api\Models\ProductSelection\ProductSelectionReferenceBuilder
Definition
ProductSelectionReferenceBuilder.php:24
Commercetools\Api\Models\ProductSelection\ProductSelectionReferenceBuilder\build
build()
Definition
ProductSelectionReferenceBuilder.php:92
Commercetools\Api\Models\ProductSelection\ProductVariantExclusionBuilder
Definition
ProductVariantExclusionBuilder.php:22
Commercetools\Api\Models\ProductSelection\ProductVariantExclusionBuilder\build
build()
Definition
ProductVariantExclusionBuilder.php:52
Commercetools\Api\Models\ProductSelection\ProductVariantSelectionBuilder
Definition
ProductVariantSelectionBuilder.php:22
Commercetools\Api\Models\ProductSelection\ProductVariantSelectionBuilder\build
build()
Definition
ProductVariantSelectionBuilder.php:23
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Product\ProductReference
Definition
ProductReference.php:16
Commercetools\Api\Models\ProductSelection\ProductSelectionAssignment
Definition
ProductSelectionAssignment.php:16
Commercetools\Api\Models\ProductSelection\ProductSelectionReference
Definition
ProductSelectionReference.php:16
Commercetools\Api\Models\ProductSelection\ProductVariantExclusion
Definition
ProductVariantExclusion.php:15
Commercetools\Api\Models\ProductSelection\ProductVariantSelection
Definition
ProductVariantSelection.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\ProductSelection
Definition
AssignedProductReference.php:9
Generated by
1.9.8