commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
AddProductChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
20 
25 {
26 
27  public const DISCRIMINATOR_VALUE = 'AddProductChange';
32  protected $type;
33 
38  protected $change;
39 
44  protected $nextValue;
45 
50  protected $variantSelection;
51 
52 
56  public function __construct(
57  ?string $change = null,
58  ?Reference $nextValue = null,
60  ?string $type = null
61  ) {
62  $this->change = $change;
63  $this->nextValue = $nextValue;
64  $this->variantSelection = $variantSelection;
65  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
66  }
67 
72  public function getType()
73  {
74  if (is_null($this->type)) {
76  $data = $this->raw(self::FIELD_TYPE);
77  if (is_null($data)) {
78  return null;
79  }
80  $this->type = (string) $data;
81  }
82 
83  return $this->type;
84  }
85 
90  public function getChange()
91  {
92  if (is_null($this->change)) {
94  $data = $this->raw(self::FIELD_CHANGE);
95  if (is_null($data)) {
96  return null;
97  }
98  $this->change = (string) $data;
99  }
100 
101  return $this->change;
102  }
103 
110  public function getNextValue()
111  {
112  if (is_null($this->nextValue)) {
114  $data = $this->raw(self::FIELD_NEXT_VALUE);
115  if (is_null($data)) {
116  return null;
117  }
118 
119  $this->nextValue = ReferenceModel::of($data);
120  }
121 
122  return $this->nextValue;
123  }
124 
131  public function getVariantSelection()
132  {
133  if (is_null($this->variantSelection)) {
135  $data = $this->raw(self::FIELD_VARIANT_SELECTION);
136  if (is_null($data)) {
137  return null;
138  }
139 
140  $this->variantSelection = ProductVariantSelectionModel::of($data);
141  }
142 
144  }
145 
146 
150  public function setChange(?string $change): void
151  {
152  $this->change = $change;
153  }
154 
158  public function setNextValue(?Reference $nextValue): void
159  {
160  $this->nextValue = $nextValue;
161  }
162 
167  {
168  $this->variantSelection = $variantSelection;
169  }
170 
171 
172 
173 }
setVariantSelection(?ProductVariantSelection $variantSelection)
__construct(?string $change=null, ?Reference $nextValue=null, ?ProductVariantSelection $variantSelection=null, ?string $type=null)