commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ExtensionNoResponseErrorModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'ExtensionNoResponse';
27  protected $code;
28 
33  protected $message;
34 
39  protected $extensionId;
40 
45  protected $extensionKey;
46 
47 
51  public function __construct(
52  ?string $message = null,
53  ?string $extensionId = null,
54  ?string $extensionKey = null,
55  ?string $code = null
56  ) {
57  $this->message = $message;
58  $this->extensionId = $extensionId;
59  $this->extensionKey = $extensionKey;
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 
87  public function getMessage()
88  {
89  if (is_null($this->message)) {
91  $data = $this->raw(self::FIELD_MESSAGE);
92  if (is_null($data)) {
93  return null;
94  }
95  $this->message = (string) $data;
96  }
97 
98  return $this->message;
99  }
100 
107  public function getExtensionId()
108  {
109  if (is_null($this->extensionId)) {
111  $data = $this->raw(self::FIELD_EXTENSION_ID);
112  if (is_null($data)) {
113  return null;
114  }
115  $this->extensionId = (string) $data;
116  }
117 
118  return $this->extensionId;
119  }
120 
127  public function getExtensionKey()
128  {
129  if (is_null($this->extensionKey)) {
131  $data = $this->raw(self::FIELD_EXTENSION_KEY);
132  if (is_null($data)) {
133  return null;
134  }
135  $this->extensionKey = (string) $data;
136  }
137 
138  return $this->extensionKey;
139  }
140 
141 
145  public function setMessage(?string $message): void
146  {
147  $this->message = $message;
148  }
149 
153  public function setExtensionId(?string $extensionId): void
154  {
155  $this->extensionId = $extensionId;
156  }
157 
161  public function setExtensionKey(?string $extensionKey): void
162  {
163  $this->extensionKey = $extensionKey;
164  }
165 
169  public function by(string $key)
170  {
171  $data = $this->raw($key);
172  if (is_null($data)) {
173  return null;
174  }
175 
176  return $data;
177  }
178 }
__construct(?string $message=null, ?string $extensionId=null, ?string $extensionKey=null, ?string $code=null)