commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChangeAssetNameChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
20 
25 {
26 
27  public const DISCRIMINATOR_VALUE = 'ChangeAssetNameChange';
32  protected $type;
33 
38  protected $change;
39 
44  protected $previousValue;
45 
50  protected $nextValue;
51 
56  protected $asset;
57 
58 
62  public function __construct(
63  ?string $change = null,
66  ?AssetChangeValue $asset = null,
67  ?string $type = null
68  ) {
69  $this->change = $change;
70  $this->previousValue = $previousValue;
71  $this->nextValue = $nextValue;
72  $this->asset = $asset;
73  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
74  }
75 
80  public function getType()
81  {
82  if (is_null($this->type)) {
84  $data = $this->raw(self::FIELD_TYPE);
85  if (is_null($data)) {
86  return null;
87  }
88  $this->type = (string) $data;
89  }
90 
91  return $this->type;
92  }
93 
98  public function getChange()
99  {
100  if (is_null($this->change)) {
102  $data = $this->raw(self::FIELD_CHANGE);
103  if (is_null($data)) {
104  return null;
105  }
106  $this->change = (string) $data;
107  }
108 
109  return $this->change;
110  }
111 
118  public function getPreviousValue()
119  {
120  if (is_null($this->previousValue)) {
122  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
123  if (is_null($data)) {
124  return null;
125  }
126 
127  $this->previousValue = LocalizedStringModel::of($data);
128  }
129 
130  return $this->previousValue;
131  }
132 
139  public function getNextValue()
140  {
141  if (is_null($this->nextValue)) {
143  $data = $this->raw(self::FIELD_NEXT_VALUE);
144  if (is_null($data)) {
145  return null;
146  }
147 
148  $this->nextValue = LocalizedStringModel::of($data);
149  }
150 
151  return $this->nextValue;
152  }
153 
160  public function getAsset()
161  {
162  if (is_null($this->asset)) {
164  $data = $this->raw(self::FIELD_ASSET);
165  if (is_null($data)) {
166  return null;
167  }
168 
169  $this->asset = AssetChangeValueModel::of($data);
170  }
171 
172  return $this->asset;
173  }
174 
175 
179  public function setChange(?string $change): void
180  {
181  $this->change = $change;
182  }
183 
188  {
189  $this->previousValue = $previousValue;
190  }
191 
195  public function setNextValue(?LocalizedString $nextValue): void
196  {
197  $this->nextValue = $nextValue;
198  }
199 
203  public function setAsset(?AssetChangeValue $asset): void
204  {
205  $this->asset = $asset;
206  }
207 
208 
209 
210 }
static of($data=null)
Definition: MapperMap.php:45
__construct(?string $change=null, ?LocalizedString $previousValue=null, ?LocalizedString $nextValue=null, ?AssetChangeValue $asset=null, ?string $type=null)