commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetAssetSourcesChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
20 
24 final class SetAssetSourcesChangeBuilder implements Builder
25 {
30  private $change;
31 
36  private $previousValue;
37 
42  private $nextValue;
43 
48  private $asset;
49 
54  public function getChange()
55  {
56  return $this->change;
57  }
58 
65  public function getPreviousValue()
66  {
67  return $this->previousValue;
68  }
69 
76  public function getNextValue()
77  {
78  return $this->nextValue;
79  }
80 
87  public function getAsset()
88  {
89  return $this->asset instanceof AssetChangeValueBuilder ? $this->asset->build() : $this->asset;
90  }
91 
96  public function withChange(?string $change)
97  {
98  $this->change = $change;
99 
100  return $this;
101  }
102 
107  public function withPreviousValue(?AssetSourceCollection $previousValue)
108  {
109  $this->previousValue = $previousValue;
110 
111  return $this;
112  }
113 
118  public function withNextValue(?AssetSourceCollection $nextValue)
119  {
120  $this->nextValue = $nextValue;
121 
122  return $this;
123  }
124 
129  public function withAsset(?AssetChangeValue $asset)
130  {
131  $this->asset = $asset;
132 
133  return $this;
134  }
135 
140  public function withAssetBuilder(?AssetChangeValueBuilder $asset)
141  {
142  $this->asset = $asset;
143 
144  return $this;
145  }
146 
147  public function build(): SetAssetSourcesChange
148  {
149  return new SetAssetSourcesChangeModel(
150  $this->change,
151  $this->previousValue,
152  $this->nextValue,
153  $this->asset instanceof AssetChangeValueBuilder ? $this->asset->build() : $this->asset
154  );
155  }
156 
157  public static function of(): SetAssetSourcesChangeBuilder
158  {
159  return new self();
160  }
161 }