commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetAssetKeyChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final class SetAssetKeyChangeBuilder implements Builder
24{
29 private $change;
30
35 private $previousValue;
36
41 private $nextValue;
42
47 private $asset;
48
53 public function getChange()
54 {
55 return $this->change;
56 }
57
64 public function getPreviousValue()
65 {
66 return $this->previousValue;
67 }
68
75 public function getNextValue()
76 {
77 return $this->nextValue;
78 }
79
86 public function getAsset()
87 {
88 return $this->asset instanceof AssetChangeValueBuilder ? $this->asset->build() : $this->asset;
89 }
90
95 public function withChange(?string $change)
96 {
97 $this->change = $change;
98
99 return $this;
100 }
101
106 public function withPreviousValue(?string $previousValue)
107 {
108 $this->previousValue = $previousValue;
109
110 return $this;
111 }
112
117 public function withNextValue(?string $nextValue)
118 {
119 $this->nextValue = $nextValue;
120
121 return $this;
122 }
123
128 public function withAsset(?AssetChangeValue $asset)
129 {
130 $this->asset = $asset;
131
132 return $this;
133 }
134
140 {
141 $this->asset = $asset;
142
143 return $this;
144 }
145
146 public function build(): SetAssetKeyChange
147 {
148 return new SetAssetKeyChangeModel(
149 $this->change,
150 $this->previousValue,
151 $this->nextValue,
152 $this->asset instanceof AssetChangeValueBuilder ? $this->asset->build() : $this->asset
153 );
154 }
155
156 public static function of(): SetAssetKeyChangeBuilder
157 {
158 return new self();
159 }
160}