commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AddEnumValueChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'AddEnumValueChange';
30 protected $type;
31
36 protected $change;
37
42 protected $nextValue;
43
48 protected $fieldName;
49
50
54 public function __construct(
55 ?string $change = null,
56 ?EnumValue $nextValue = null,
57 ?string $fieldName = null,
58 ?string $type = null
59 ) {
60 $this->change = $change;
61 $this->nextValue = $nextValue;
62 $this->fieldName = $fieldName;
63 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
64 }
65
70 public function getType()
71 {
72 if (is_null($this->type)) {
74 $data = $this->raw(self::FIELD_TYPE);
75 if (is_null($data)) {
76 return null;
77 }
78 $this->type = (string) $data;
79 }
80
81 return $this->type;
82 }
83
88 public function getChange()
89 {
90 if (is_null($this->change)) {
92 $data = $this->raw(self::FIELD_CHANGE);
93 if (is_null($data)) {
94 return null;
95 }
96 $this->change = (string) $data;
97 }
98
99 return $this->change;
100 }
101
108 public function getNextValue()
109 {
110 if (is_null($this->nextValue)) {
112 $data = $this->raw(self::FIELD_NEXT_VALUE);
113 if (is_null($data)) {
114 return null;
115 }
116
117 $this->nextValue = EnumValueModel::of($data);
118 }
119
120 return $this->nextValue;
121 }
122
129 public function getFieldName()
130 {
131 if (is_null($this->fieldName)) {
133 $data = $this->raw(self::FIELD_FIELD_NAME);
134 if (is_null($data)) {
135 return null;
136 }
137 $this->fieldName = (string) $data;
138 }
139
140 return $this->fieldName;
141 }
142
143
147 public function setChange(?string $change): void
148 {
149 $this->change = $change;
150 }
151
155 public function setNextValue(?EnumValue $nextValue): void
156 {
157 $this->nextValue = $nextValue;
158 }
159
163 public function setFieldName(?string $fieldName): void
164 {
165 $this->fieldName = $fieldName;
166 }
167
168
169
170}
__construct(?string $change=null, ?EnumValue $nextValue=null, ?string $fieldName=null, ?string $type=null)