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
SetAttributeChangeBuilder.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\ChangeValue\AttributeValue
;
18
use
Commercetools\History\Models\ChangeValue\AttributeValueBuilder
;
19
23
final
class
SetAttributeChangeBuilder
implements
Builder
24
{
29
private
$change;
30
35
private
$previousValue;
36
41
private
$nextValue;
42
47
private
$catalogData;
48
53
public
function
getChange
()
54
{
55
return
$this->change;
56
}
57
64
public
function
getPreviousValue
()
65
{
66
return
$this->previousValue instanceof
AttributeValueBuilder
? $this->previousValue->
build
() : $this->previousValue;
67
}
68
75
public
function
getNextValue
()
76
{
77
return
$this->nextValue instanceof
AttributeValueBuilder
? $this->nextValue->
build
() : $this->nextValue;
78
}
79
89
public
function
getCatalogData
()
90
{
91
return
$this->catalogData;
92
}
93
98
public
function
withChange
(?
string
$change)
99
{
100
$this->change = $change;
101
102
return
$this;
103
}
104
109
public
function
withPreviousValue
(?
AttributeValue
$previousValue)
110
{
111
$this->previousValue = $previousValue;
112
113
return
$this;
114
}
115
120
public
function
withNextValue
(?
AttributeValue
$nextValue)
121
{
122
$this->nextValue = $nextValue;
123
124
return
$this;
125
}
126
131
public
function
withCatalogData
(?
string
$catalogData)
132
{
133
$this->catalogData = $catalogData;
134
135
return
$this;
136
}
137
142
public
function
withPreviousValueBuilder
(?
AttributeValueBuilder
$previousValue)
143
{
144
$this->previousValue = $previousValue;
145
146
return
$this;
147
}
148
153
public
function
withNextValueBuilder
(?
AttributeValueBuilder
$nextValue)
154
{
155
$this->nextValue = $nextValue;
156
157
return
$this;
158
}
159
160
public
function
build
():
SetAttributeChange
161
{
162
return
new
SetAttributeChangeModel
(
163
$this->change,
164
$this->previousValue instanceof
AttributeValueBuilder
? $this->previousValue->
build
() : $this->previousValue,
165
$this->nextValue instanceof
AttributeValueBuilder
? $this->nextValue->
build
() : $this->nextValue,
166
$this->catalogData
167
);
168
}
169
170
public
static
function
of
():
SetAttributeChangeBuilder
171
{
172
return
new
self
();
173
}
174
}
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\SetAttributeChangeBuilder
Definition
SetAttributeChangeBuilder.php:24
Commercetools\History\Models\Change\SetAttributeChangeBuilder\getNextValue
getNextValue()
Definition
SetAttributeChangeBuilder.php:75
Commercetools\History\Models\Change\SetAttributeChangeBuilder\getCatalogData
getCatalogData()
Definition
SetAttributeChangeBuilder.php:89
Commercetools\History\Models\Change\SetAttributeChangeBuilder\withNextValueBuilder
withNextValueBuilder(?AttributeValueBuilder $nextValue)
Definition
SetAttributeChangeBuilder.php:153
Commercetools\History\Models\Change\SetAttributeChangeBuilder\withPreviousValue
withPreviousValue(?AttributeValue $previousValue)
Definition
SetAttributeChangeBuilder.php:109
Commercetools\History\Models\Change\SetAttributeChangeBuilder\getChange
getChange()
Definition
SetAttributeChangeBuilder.php:53
Commercetools\History\Models\Change\SetAttributeChangeBuilder\getPreviousValue
getPreviousValue()
Definition
SetAttributeChangeBuilder.php:64
Commercetools\History\Models\Change\SetAttributeChangeBuilder\withCatalogData
withCatalogData(?string $catalogData)
Definition
SetAttributeChangeBuilder.php:131
Commercetools\History\Models\Change\SetAttributeChangeBuilder\withNextValue
withNextValue(?AttributeValue $nextValue)
Definition
SetAttributeChangeBuilder.php:120
Commercetools\History\Models\Change\SetAttributeChangeBuilder\build
build()
Definition
SetAttributeChangeBuilder.php:160
Commercetools\History\Models\Change\SetAttributeChangeBuilder\of
static of()
Definition
SetAttributeChangeBuilder.php:170
Commercetools\History\Models\Change\SetAttributeChangeBuilder\withPreviousValueBuilder
withPreviousValueBuilder(?AttributeValueBuilder $previousValue)
Definition
SetAttributeChangeBuilder.php:142
Commercetools\History\Models\Change\SetAttributeChangeBuilder\withChange
withChange(?string $change)
Definition
SetAttributeChangeBuilder.php:98
Commercetools\History\Models\Change\SetAttributeChangeModel
Definition
SetAttributeChangeModel.php:23
Commercetools\History\Models\ChangeValue\AttributeValueBuilder
Definition
AttributeValueBuilder.php:22
Commercetools\History\Models\ChangeValue\AttributeValueBuilder\build
build()
Definition
AttributeValueBuilder.php:89
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetAttributeChange
Definition
SetAttributeChange.php:16
Commercetools\History\Models\ChangeValue\AttributeValue
Definition
AttributeValue.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8