commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ConcurrentModificationErrorModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'ConcurrentModification';
27  protected $code;
28 
33  protected $message;
34 
39  protected $specifiedVersion;
40 
45  protected $currentVersion;
46 
52 
53 
57  public function __construct(
58  ?string $message = null,
59  ?int $specifiedVersion = null,
60  ?int $currentVersion = null,
61  $conflictedResource = null,
62  ?string $code = null
63  ) {
64  $this->message = $message;
65  $this->specifiedVersion = $specifiedVersion;
66  $this->currentVersion = $currentVersion;
67  $this->conflictedResource = $conflictedResource;
68  $this->code = $code ?? self::DISCRIMINATOR_VALUE;
69  }
70 
75  public function getCode()
76  {
77  if (is_null($this->code)) {
79  $data = $this->raw(self::FIELD_CODE);
80  if (is_null($data)) {
81  return null;
82  }
83  $this->code = (string) $data;
84  }
85 
86  return $this->code;
87  }
88 
93  public function getMessage()
94  {
95  if (is_null($this->message)) {
97  $data = $this->raw(self::FIELD_MESSAGE);
98  if (is_null($data)) {
99  return null;
100  }
101  $this->message = (string) $data;
102  }
103 
104  return $this->message;
105  }
106 
113  public function getSpecifiedVersion()
114  {
115  if (is_null($this->specifiedVersion)) {
117  $data = $this->raw(self::FIELD_SPECIFIED_VERSION);
118  if (is_null($data)) {
119  return null;
120  }
121  $this->specifiedVersion = (int) $data;
122  }
123 
125  }
126 
133  public function getCurrentVersion()
134  {
135  if (is_null($this->currentVersion)) {
137  $data = $this->raw(self::FIELD_CURRENT_VERSION);
138  if (is_null($data)) {
139  return null;
140  }
141  $this->currentVersion = (int) $data;
142  }
143 
144  return $this->currentVersion;
145  }
146 
153  public function getConflictedResource()
154  {
155  if (is_null($this->conflictedResource)) {
157  $data = $this->raw(self::FIELD_CONFLICTED_RESOURCE);
158  if (is_null($data)) {
159  return null;
160  }
161  $this->conflictedResource = $data;
162  }
163 
165  }
166 
167 
171  public function setMessage(?string $message): void
172  {
173  $this->message = $message;
174  }
175 
179  public function setSpecifiedVersion(?int $specifiedVersion): void
180  {
181  $this->specifiedVersion = $specifiedVersion;
182  }
183 
187  public function setCurrentVersion(?int $currentVersion): void
188  {
189  $this->currentVersion = $currentVersion;
190  }
191 
196  {
197  $this->conflictedResource = $conflictedResource;
198  }
199 }
__construct(?string $message=null, ?int $specifiedVersion=null, ?int $currentVersion=null, $conflictedResource=null, ?string $code=null)