commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MoveImageToPositionChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
17 
22 {
23 
24  public const DISCRIMINATOR_VALUE = 'MoveImageToPositionChange';
29  protected $type;
30 
35  protected $change;
36 
41  protected $previousValue;
42 
47  protected $nextValue;
48 
53  protected $catalogData;
54 
55 
59  public function __construct(
60  ?string $change = null,
63  ?string $catalogData = null,
64  ?string $type = null
65  ) {
66  $this->change = $change;
67  $this->previousValue = $previousValue;
68  $this->nextValue = $nextValue;
69  $this->catalogData = $catalogData;
70  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
71  }
72 
77  public function getType()
78  {
79  if (is_null($this->type)) {
81  $data = $this->raw(self::FIELD_TYPE);
82  if (is_null($data)) {
83  return null;
84  }
85  $this->type = (string) $data;
86  }
87 
88  return $this->type;
89  }
90 
95  public function getChange()
96  {
97  if (is_null($this->change)) {
99  $data = $this->raw(self::FIELD_CHANGE);
100  if (is_null($data)) {
101  return null;
102  }
103  $this->change = (string) $data;
104  }
105 
106  return $this->change;
107  }
108 
115  public function getPreviousValue()
116  {
117  if (is_null($this->previousValue)) {
119  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
120  if (is_null($data)) {
121  return null;
122  }
123  $this->previousValue = ImageCollection::fromArray($data);
124  }
125 
126  return $this->previousValue;
127  }
128 
135  public function getNextValue()
136  {
137  if (is_null($this->nextValue)) {
139  $data = $this->raw(self::FIELD_NEXT_VALUE);
140  if (is_null($data)) {
141  return null;
142  }
143  $this->nextValue = ImageCollection::fromArray($data);
144  }
145 
146  return $this->nextValue;
147  }
148 
158  public function getCatalogData()
159  {
160  if (is_null($this->catalogData)) {
162  $data = $this->raw(self::FIELD_CATALOG_DATA);
163  if (is_null($data)) {
164  return null;
165  }
166  $this->catalogData = (string) $data;
167  }
168 
169  return $this->catalogData;
170  }
171 
172 
176  public function setChange(?string $change): void
177  {
178  $this->change = $change;
179  }
180 
185  {
186  $this->previousValue = $previousValue;
187  }
188 
192  public function setNextValue(?ImageCollection $nextValue): void
193  {
194  $this->nextValue = $nextValue;
195  }
196 
200  public function setCatalogData(?string $catalogData): void
201  {
202  $this->catalogData = $catalogData;
203  }
204 
205 
206 
207 }
__construct(?string $change=null, ?ImageCollection $previousValue=null, ?ImageCollection $nextValue=null, ?string $catalogData=null, ?string $type=null)