commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
Change
AddProductChangeBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Change
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
use
Commercetools\History\Models\Common\ProductVariantSelection
;
18
use
Commercetools\History\Models\Common\ProductVariantSelectionBuilder
;
19
use
Commercetools\History\Models\Common\Reference
;
20
use
Commercetools\History\Models\Common\ReferenceBuilder
;
21
25
final
class
AddProductChangeBuilder
implements
Builder
26
{
31
private
$change;
32
37
private
$nextValue;
38
43
private
$variantSelection;
44
49
public
function
getChange
()
50
{
51
return
$this->change;
52
}
53
60
public
function
getNextValue
()
61
{
62
return
$this->nextValue instanceof
ReferenceBuilder
? $this->nextValue->
build
() : $this->nextValue;
63
}
64
71
public
function
getVariantSelection
()
72
{
73
return
$this->variantSelection instanceof
ProductVariantSelectionBuilder
? $this->variantSelection->
build
() : $this->variantSelection;
74
}
75
80
public
function
withChange
(?
string
$change)
81
{
82
$this->change = $change;
83
84
return
$this;
85
}
86
91
public
function
withNextValue
(?
Reference
$nextValue)
92
{
93
$this->nextValue = $nextValue;
94
95
return
$this;
96
}
97
102
public
function
withVariantSelection
(?
ProductVariantSelection
$variantSelection)
103
{
104
$this->variantSelection = $variantSelection;
105
106
return
$this;
107
}
108
113
public
function
withNextValueBuilder
(?
ReferenceBuilder
$nextValue)
114
{
115
$this->nextValue = $nextValue;
116
117
return
$this;
118
}
119
124
public
function
withVariantSelectionBuilder
(?
ProductVariantSelectionBuilder
$variantSelection)
125
{
126
$this->variantSelection = $variantSelection;
127
128
return
$this;
129
}
130
131
public
function
build
():
AddProductChange
132
{
133
return
new
AddProductChangeModel
(
134
$this->change,
135
$this->nextValue instanceof
ReferenceBuilder
? $this->nextValue->
build
() : $this->nextValue,
136
$this->variantSelection instanceof
ProductVariantSelectionBuilder
? $this->variantSelection->
build
() : $this->variantSelection
137
);
138
}
139
140
public
static
function
of
():
AddProductChangeBuilder
141
{
142
return
new
self
();
143
}
144
}
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\History\Models\Change\AddProductChangeBuilder
Definition
AddProductChangeBuilder.php:26
Commercetools\History\Models\Change\AddProductChangeBuilder\withVariantSelectionBuilder
withVariantSelectionBuilder(?ProductVariantSelectionBuilder $variantSelection)
Definition
AddProductChangeBuilder.php:124
Commercetools\History\Models\Change\AddProductChangeBuilder\of
static of()
Definition
AddProductChangeBuilder.php:140
Commercetools\History\Models\Change\AddProductChangeBuilder\withNextValue
withNextValue(?Reference $nextValue)
Definition
AddProductChangeBuilder.php:91
Commercetools\History\Models\Change\AddProductChangeBuilder\getNextValue
getNextValue()
Definition
AddProductChangeBuilder.php:60
Commercetools\History\Models\Change\AddProductChangeBuilder\withChange
withChange(?string $change)
Definition
AddProductChangeBuilder.php:80
Commercetools\History\Models\Change\AddProductChangeBuilder\getVariantSelection
getVariantSelection()
Definition
AddProductChangeBuilder.php:71
Commercetools\History\Models\Change\AddProductChangeBuilder\withNextValueBuilder
withNextValueBuilder(?ReferenceBuilder $nextValue)
Definition
AddProductChangeBuilder.php:113
Commercetools\History\Models\Change\AddProductChangeBuilder\build
build()
Definition
AddProductChangeBuilder.php:131
Commercetools\History\Models\Change\AddProductChangeBuilder\getChange
getChange()
Definition
AddProductChangeBuilder.php:49
Commercetools\History\Models\Change\AddProductChangeBuilder\withVariantSelection
withVariantSelection(?ProductVariantSelection $variantSelection)
Definition
AddProductChangeBuilder.php:102
Commercetools\History\Models\Change\AddProductChangeModel
Definition
AddProductChangeModel.php:25
Commercetools\History\Models\Common\ProductVariantSelectionBuilder
Definition
ProductVariantSelectionBuilder.php:22
Commercetools\History\Models\Common\ProductVariantSelectionBuilder\build
build()
Definition
ProductVariantSelectionBuilder.php:76
Commercetools\History\Models\Common\ReferenceBuilder
Definition
ReferenceBuilder.php:22
Commercetools\History\Models\Common\ReferenceBuilder\build
build()
Definition
ReferenceBuilder.php:76
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddProductChange
Definition
AddProductChange.php:17
Commercetools\History\Models\Common\ProductVariantSelection
Definition
ProductVariantSelection.php:15
Commercetools\History\Models\Common\Reference
Definition
Reference.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8