3declare(strict_types=1);
218 if (is_null($this->
id)) {
220 $data = $this->
raw(self::FIELD_ID);
221 if (is_null($data)) {
224 $this->
id = (string) $data;
238 if (is_null($this->version)) {
240 $data = $this->
raw(self::FIELD_VERSION);
241 if (is_null($data)) {
244 $this->version = (int) $data;
258 if (is_null($this->createdAt)) {
260 $data = $this->
raw(self::FIELD_CREATED_AT);
261 if (is_null($data)) {
264 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
265 if (
false === $data) {
268 $this->createdAt = $data;
282 if (is_null($this->lastModifiedAt)) {
284 $data = $this->
raw(self::FIELD_LAST_MODIFIED_AT);
285 if (is_null($data)) {
288 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
289 if (
false === $data) {
292 $this->lastModifiedAt = $data;
306 if (is_null($this->lastModifiedBy)) {
308 $data = $this->
raw(self::FIELD_LAST_MODIFIED_BY);
309 if (is_null($data)) {
313 $this->lastModifiedBy = LastModifiedByModel::of($data);
327 if (is_null($this->createdBy)) {
329 $data = $this->
raw(self::FIELD_CREATED_BY);
330 if (is_null($data)) {
334 $this->createdBy = CreatedByModel::of($data);
348 if (is_null($this->key)) {
350 $data = $this->
raw(self::FIELD_KEY);
351 if (is_null($data)) {
354 $this->key = (string) $data;
368 if (is_null($this->sku)) {
370 $data = $this->
raw(self::FIELD_SKU);
371 if (is_null($data)) {
374 $this->sku = (string) $data;
388 if (is_null($this->value)) {
390 $data = $this->
raw(self::FIELD_VALUE);
391 if (is_null($data)) {
394 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
395 $this->value = $className::of($data);
409 if (is_null($this->country)) {
411 $data = $this->
raw(self::FIELD_COUNTRY);
412 if (is_null($data)) {
415 $this->country = (string) $data;
429 if (is_null($this->customerGroup)) {
431 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
432 if (is_null($data)) {
436 $this->customerGroup = CustomerGroupReferenceModel::of($data);
450 if (is_null($this->channel)) {
452 $data = $this->
raw(self::FIELD_CHANNEL);
453 if (is_null($data)) {
457 $this->channel = ChannelReferenceModel::of($data);
471 if (is_null($this->validFrom)) {
473 $data = $this->
raw(self::FIELD_VALID_FROM);
474 if (is_null($data)) {
477 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
478 if (
false === $data) {
481 $this->validFrom = $data;
495 if (is_null($this->validUntil)) {
497 $data = $this->
raw(self::FIELD_VALID_UNTIL);
498 if (is_null($data)) {
501 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
502 if (
false === $data) {
505 $this->validUntil = $data;
520 if (is_null($this->tiers)) {
522 $data = $this->
raw(self::FIELD_TIERS);
523 if (is_null($data)) {
526 $this->tiers = PriceTierCollection::fromArray($data);
542 if (is_null($this->discounted)) {
544 $data = $this->
raw(self::FIELD_DISCOUNTED);
545 if (is_null($data)) {
549 $this->discounted = DiscountedPriceModel::of($data);
563 if (is_null($this->custom)) {
565 $data = $this->
raw(self::FIELD_CUSTOM);
566 if (is_null($data)) {
570 $this->custom = CustomFieldsModel::of($data);
584 if (is_null($this->staged)) {
586 $data = $this->
raw(self::FIELD_STAGED);
587 if (is_null($data)) {
606 if (is_null($this->active)) {
608 $data = $this->
raw(self::FIELD_ACTIVE);
609 if (is_null($data)) {
612 $this->active = (bool) $data;
626 if (is_null($this->recurrencePolicy)) {
628 $data = $this->
raw(self::FIELD_RECURRENCE_POLICY);
629 if (is_null($data)) {
633 $this->recurrencePolicy = RecurrencePolicyReferenceModel::of($data);
801 #[\ReturnTypeWillChange]
820 return (
object) $data;