commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
InvalidStateTransitionErrorModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use 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 
67  public function getCode()
68  {
69  if (is_null($this->code)) {
71  $data = $this->raw(self::FIELD_CODE);
72  if (is_null($data)) {
73  return null;
74  }
75  $this->code = (string) $data;
76  }
77 
78  return $this->code;
79  }
80 
85  public function getMessage()
86  {
87  if (is_null($this->message)) {
89  $data = $this->raw(self::FIELD_MESSAGE);
90  if (is_null($data)) {
91  return null;
92  }
93  $this->message = (string) $data;
94  }
95 
96  return $this->message;
97  }
98 
105  public function getCurrentState()
106  {
107  if (is_null($this->currentState)) {
109  $data = $this->raw(self::FIELD_CURRENT_STATE);
110  if (is_null($data)) {
111  return null;
112  }
113  $this->currentState = (string) $data;
114  }
115 
116  return $this->currentState;
117  }
118 
125  public function getNewState()
126  {
127  if (is_null($this->newState)) {
129  $data = $this->raw(self::FIELD_NEW_STATE);
130  if (is_null($data)) {
131  return null;
132  }
133  $this->newState = (string) $data;
134  }
135 
136  return $this->newState;
137  }
138 
139 
143  public function setMessage(?string $message): void
144  {
145  $this->message = $message;
146  }
147 
151  public function setCurrentState(?string $currentState): void
152  {
153  $this->currentState = $currentState;
154  }
155 
159  public function setNewState(?string $newState): void
160  {
161  $this->newState = $newState;
162  }
163 }
__construct(?string $message=null, ?string $currentState=null, ?string $newState=null, ?string $code=null)