commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
InvalidStateTransitionErrorModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'InvalidTransition';
27 protected $code;
28
33 protected $message;
34
39 protected $currentState;
40
45 protected $newState;
46
47
51 public function __construct(
52 ?string $message = null,
53 ?string $currentState = null,
54 ?string $newState = null,
55 ?string $code = null
56 ) {
57 $this->message = $message;
58 $this->currentState = $currentState;
59 $this->newState = $newState;
60 $this->code = $code ?? self::DISCRIMINATOR_VALUE;
61 }
62
69 public function getCode()
70 {
71 if (is_null($this->code)) {
73 $data = $this->raw(self::FIELD_CODE);
74 if (is_null($data)) {
75 return null;
76 }
77 $this->code = (string) $data;
78 }
79
80 return $this->code;
81 }
82
89 public function getMessage()
90 {
91 if (is_null($this->message)) {
93 $data = $this->raw(self::FIELD_MESSAGE);
94 if (is_null($data)) {
95 return null;
96 }
97 $this->message = (string) $data;
98 }
99
100 return $this->message;
101 }
102
109 public function getCurrentState()
110 {
111 if (is_null($this->currentState)) {
113 $data = $this->raw(self::FIELD_CURRENT_STATE);
114 if (is_null($data)) {
115 return null;
116 }
117 $this->currentState = (string) $data;
118 }
119
120 return $this->currentState;
121 }
122
129 public function getNewState()
130 {
131 if (is_null($this->newState)) {
133 $data = $this->raw(self::FIELD_NEW_STATE);
134 if (is_null($data)) {
135 return null;
136 }
137 $this->newState = (string) $data;
138 }
139
140 return $this->newState;
141 }
142
143
147 public function setMessage(?string $message): void
148 {
149 $this->message = $message;
150 }
151
155 public function setCurrentState(?string $currentState): void
156 {
157 $this->currentState = $currentState;
158 }
159
163 public function setNewState(?string $newState): void
164 {
165 $this->newState = $newState;
166 }
167}
__construct(?string $message=null, ?string $currentState=null, ?string $newState=null, ?string $code=null)