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
AssignedProductReferenceBuilder.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
AssignedProductReferenceBuilder
implements
Builder
24
{
29
private
$product;
30
35
private
$variantSelection;
36
41
private
$variantExclusion;
42
49
public
function
getProduct
()
50
{
51
return
$this->product instanceof
ProductReferenceBuilder
? $this->product->
build
() : $this->product;
52
}
53
62
public
function
getVariantSelection
()
63
{
64
return
$this->variantSelection instanceof
ProductVariantSelectionBuilder
? $this->variantSelection->
build
() : $this->variantSelection;
65
}
66
75
public
function
getVariantExclusion
()
76
{
77
return
$this->variantExclusion instanceof
ProductVariantExclusionBuilder
? $this->variantExclusion->
build
() : $this->variantExclusion;
78
}
79
84
public
function
withProduct
(?
ProductReference
$product)
85
{
86
$this->product = $product;
87
88
return
$this;
89
}
90
95
public
function
withVariantSelection
(?
ProductVariantSelection
$variantSelection)
96
{
97
$this->variantSelection = $variantSelection;
98
99
return
$this;
100
}
101
106
public
function
withVariantExclusion
(?
ProductVariantExclusion
$variantExclusion)
107
{
108
$this->variantExclusion = $variantExclusion;
109
110
return
$this;
111
}
112
117
public
function
withProductBuilder
(?
ProductReferenceBuilder
$product)
118
{
119
$this->product = $product;
120
121
return
$this;
122
}
123
128
public
function
withVariantSelectionBuilder
(?
ProductVariantSelectionBuilder
$variantSelection)
129
{
130
$this->variantSelection = $variantSelection;
131
132
return
$this;
133
}
134
139
public
function
withVariantExclusionBuilder
(?
ProductVariantExclusionBuilder
$variantExclusion)
140
{
141
$this->variantExclusion = $variantExclusion;
142
143
return
$this;
144
}
145
146
public
function
build
():
AssignedProductReference
147
{
148
return
new
AssignedProductReferenceModel
(
149
$this->product instanceof
ProductReferenceBuilder
? $this->product->
build
() : $this->product,
150
$this->variantSelection instanceof
ProductVariantSelectionBuilder
? $this->variantSelection->
build
() : $this->variantSelection,
151
$this->variantExclusion instanceof
ProductVariantExclusionBuilder
? $this->variantExclusion->
build
() : $this->variantExclusion
152
);
153
}
154
155
public
static
function
of
():
AssignedProductReferenceBuilder
156
{
157
return
new
self
();
158
}
159
}
Commercetools\Api\Models\Product\ProductReferenceBuilder
Definition
ProductReferenceBuilder.php:24
Commercetools\Api\Models\Product\ProductReferenceBuilder\build
build()
Definition
ProductReferenceBuilder.php:92
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder
Definition
AssignedProductReferenceBuilder.php:24
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\build
build()
Definition
AssignedProductReferenceBuilder.php:146
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\withVariantSelectionBuilder
withVariantSelectionBuilder(?ProductVariantSelectionBuilder $variantSelection)
Definition
AssignedProductReferenceBuilder.php:128
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\withProductBuilder
withProductBuilder(?ProductReferenceBuilder $product)
Definition
AssignedProductReferenceBuilder.php:117
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\withProduct
withProduct(?ProductReference $product)
Definition
AssignedProductReferenceBuilder.php:84
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\withVariantSelection
withVariantSelection(?ProductVariantSelection $variantSelection)
Definition
AssignedProductReferenceBuilder.php:95
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\withVariantExclusion
withVariantExclusion(?ProductVariantExclusion $variantExclusion)
Definition
AssignedProductReferenceBuilder.php:106
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\getVariantExclusion
getVariantExclusion()
Definition
AssignedProductReferenceBuilder.php:75
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\of
static of()
Definition
AssignedProductReferenceBuilder.php:155
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\getProduct
getProduct()
Definition
AssignedProductReferenceBuilder.php:49
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\withVariantExclusionBuilder
withVariantExclusionBuilder(?ProductVariantExclusionBuilder $variantExclusion)
Definition
AssignedProductReferenceBuilder.php:139
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceBuilder\getVariantSelection
getVariantSelection()
Definition
AssignedProductReferenceBuilder.php:62
Commercetools\Api\Models\ProductSelection\AssignedProductReferenceModel
Definition
AssignedProductReferenceModel.php:23
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\AssignedProductReference
Definition
AssignedProductReference.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