3declare(strict_types=1);
203 if (is_null($this->
id)) {
205 $data = $this->
raw(self::FIELD_ID);
206 if (is_null($data)) {
209 $this->
id = (string) $data;
223 if (is_null($this->version)) {
225 $data = $this->
raw(self::FIELD_VERSION);
226 if (is_null($data)) {
229 $this->version = (int) $data;
243 if (is_null($this->createdAt)) {
245 $data = $this->
raw(self::FIELD_CREATED_AT);
246 if (is_null($data)) {
249 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
250 if (
false === $data) {
253 $this->createdAt = $data;
267 if (is_null($this->lastModifiedAt)) {
269 $data = $this->
raw(self::FIELD_LAST_MODIFIED_AT);
270 if (is_null($data)) {
273 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
274 if (
false === $data) {
277 $this->lastModifiedAt = $data;
291 if (is_null($this->lastModifiedBy)) {
293 $data = $this->
raw(self::FIELD_LAST_MODIFIED_BY);
294 if (is_null($data)) {
298 $this->lastModifiedBy = LastModifiedByModel::of($data);
312 if (is_null($this->createdBy)) {
314 $data = $this->
raw(self::FIELD_CREATED_BY);
315 if (is_null($data)) {
319 $this->createdBy = CreatedByModel::of($data);
334 if (is_null($this->sequenceNumber)) {
336 $data = $this->
raw(self::FIELD_SEQUENCE_NUMBER);
337 if (is_null($data)) {
340 $this->sequenceNumber = (int) $data;
354 if (is_null($this->resource)) {
356 $data = $this->
raw(self::FIELD_RESOURCE);
357 if (is_null($data)) {
360 $className = ReferenceModel::resolveDiscriminatorClass($data);
361 $this->resource = $className::of($data);
375 if (is_null($this->resourceVersion)) {
377 $data = $this->
raw(self::FIELD_RESOURCE_VERSION);
378 if (is_null($data)) {
381 $this->resourceVersion = (int) $data;
395 if (is_null($this->type)) {
397 $data = $this->
raw(self::FIELD_TYPE);
398 if (is_null($data)) {
401 $this->type = (string) $data;
415 if (is_null($this->resourceUserProvidedIdentifiers)) {
417 $data = $this->
raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS);
418 if (is_null($data)) {
436 if (is_null($this->product)) {
438 $data = $this->
raw(self::FIELD_PRODUCT);
439 if (is_null($data)) {
443 $this->product = ProductReferenceModel::of($data);
457 if (is_null($this->variantId)) {
459 $data = $this->
raw(self::FIELD_VARIANT_ID);
460 if (is_null($data)) {
463 $this->variantId = (int) $data;
477 if (is_null($this->key)) {
479 $data = $this->
raw(self::FIELD_KEY);
480 if (is_null($data)) {
483 $this->key = (string) $data;
497 if (is_null($this->sku)) {
499 $data = $this->
raw(self::FIELD_SKU);
500 if (is_null($data)) {
503 $this->sku = (string) $data;
517 if (is_null($this->attributes)) {
519 $data = $this->
raw(self::FIELD_ATTRIBUTES);
520 if (is_null($data)) {
523 $this->attributes = AttributeCollection::fromArray($data);
537 if (is_null($this->assets)) {
539 $data = $this->
raw(self::FIELD_ASSETS);
540 if (is_null($data)) {
543 $this->assets = AssetCollection::fromArray($data);
557 if (is_null($this->images)) {
559 $data = $this->
raw(self::FIELD_IMAGES);
560 if (is_null($data)) {
563 $this->images = ImageCollection::fromArray($data);
577 if (is_null($this->publish)) {
579 $data = $this->
raw(self::FIELD_PUBLISH);
580 if (is_null($data)) {
583 $this->publish = (bool) $data;
735 #[\ReturnTypeWillChange]
746 return (
object) $data;