commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetValidUntilChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22 
23  public const DISCRIMINATOR_VALUE = 'SetValidUntilChange';
28  protected $type;
29 
34  protected $change;
35 
40  protected $previousValue;
41 
46  protected $nextValue;
47 
48 
52  public function __construct(
53  ?string $change = null,
54  ?string $previousValue = null,
55  ?string $nextValue = null,
56  ?string $type = null
57  ) {
58  $this->change = $change;
59  $this->previousValue = $previousValue;
60  $this->nextValue = $nextValue;
61  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
62  }
63 
68  public function getType()
69  {
70  if (is_null($this->type)) {
72  $data = $this->raw(self::FIELD_TYPE);
73  if (is_null($data)) {
74  return null;
75  }
76  $this->type = (string) $data;
77  }
78 
79  return $this->type;
80  }
81 
86  public function getChange()
87  {
88  if (is_null($this->change)) {
90  $data = $this->raw(self::FIELD_CHANGE);
91  if (is_null($data)) {
92  return null;
93  }
94  $this->change = (string) $data;
95  }
96 
97  return $this->change;
98  }
99 
106  public function getPreviousValue()
107  {
108  if (is_null($this->previousValue)) {
110  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
111  if (is_null($data)) {
112  return null;
113  }
114  $this->previousValue = (string) $data;
115  }
116 
117  return $this->previousValue;
118  }
119 
126  public function getNextValue()
127  {
128  if (is_null($this->nextValue)) {
130  $data = $this->raw(self::FIELD_NEXT_VALUE);
131  if (is_null($data)) {
132  return null;
133  }
134  $this->nextValue = (string) $data;
135  }
136 
137  return $this->nextValue;
138  }
139 
140 
144  public function setChange(?string $change): void
145  {
146  $this->change = $change;
147  }
148 
152  public function setPreviousValue(?string $previousValue): void
153  {
154  $this->previousValue = $previousValue;
155  }
156 
160  public function setNextValue(?string $nextValue): void
161  {
162  $this->nextValue = $nextValue;
163  }
164 
165 
166 
167 }
__construct(?string $change=null, ?string $previousValue=null, ?string $nextValue=null, ?string $type=null)