3declare(strict_types=1);
208 if (is_null($this->
id)) {
210 $data = $this->
raw(self::FIELD_ID);
211 if (is_null($data)) {
214 $this->
id = (string) $data;
228 if (is_null($this->version)) {
230 $data = $this->
raw(self::FIELD_VERSION);
231 if (is_null($data)) {
234 $this->version = (int) $data;
248 if (is_null($this->createdAt)) {
250 $data = $this->
raw(self::FIELD_CREATED_AT);
251 if (is_null($data)) {
254 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
255 if (
false === $data) {
258 $this->createdAt = $data;
272 if (is_null($this->lastModifiedAt)) {
274 $data = $this->
raw(self::FIELD_LAST_MODIFIED_AT);
275 if (is_null($data)) {
278 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
279 if (
false === $data) {
282 $this->lastModifiedAt = $data;
296 if (is_null($this->lastModifiedBy)) {
298 $data = $this->
raw(self::FIELD_LAST_MODIFIED_BY);
299 if (is_null($data)) {
303 $this->lastModifiedBy = LastModifiedByModel::of($data);
317 if (is_null($this->createdBy)) {
319 $data = $this->
raw(self::FIELD_CREATED_BY);
320 if (is_null($data)) {
324 $this->createdBy = CreatedByModel::of($data);
338 if (is_null($this->key)) {
340 $data = $this->
raw(self::FIELD_KEY);
341 if (is_null($data)) {
344 $this->key = (string) $data;
358 if (is_null($this->sku)) {
360 $data = $this->
raw(self::FIELD_SKU);
361 if (is_null($data)) {
364 $this->sku = (string) $data;
378 if (is_null($this->value)) {
380 $data = $this->
raw(self::FIELD_VALUE);
381 if (is_null($data)) {
384 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
385 $this->value = $className::of($data);
399 if (is_null($this->country)) {
401 $data = $this->
raw(self::FIELD_COUNTRY);
402 if (is_null($data)) {
405 $this->country = (string) $data;
419 if (is_null($this->customerGroup)) {
421 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
422 if (is_null($data)) {
426 $this->customerGroup = CustomerGroupReferenceModel::of($data);
440 if (is_null($this->channel)) {
442 $data = $this->
raw(self::FIELD_CHANNEL);
443 if (is_null($data)) {
447 $this->channel = ChannelReferenceModel::of($data);
461 if (is_null($this->validFrom)) {
463 $data = $this->
raw(self::FIELD_VALID_FROM);
464 if (is_null($data)) {
467 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
468 if (
false === $data) {
471 $this->validFrom = $data;
485 if (is_null($this->validUntil)) {
487 $data = $this->
raw(self::FIELD_VALID_UNTIL);
488 if (is_null($data)) {
491 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
492 if (
false === $data) {
495 $this->validUntil = $data;
510 if (is_null($this->tiers)) {
512 $data = $this->
raw(self::FIELD_TIERS);
513 if (is_null($data)) {
516 $this->tiers = PriceTierCollection::fromArray($data);
531 if (is_null($this->discounted)) {
533 $data = $this->
raw(self::FIELD_DISCOUNTED);
534 if (is_null($data)) {
538 $this->discounted = DiscountedPriceModel::of($data);
552 if (is_null($this->custom)) {
554 $data = $this->
raw(self::FIELD_CUSTOM);
555 if (is_null($data)) {
559 $this->custom = CustomFieldsModel::of($data);
573 if (is_null($this->staged)) {
575 $data = $this->
raw(self::FIELD_STAGED);
576 if (is_null($data)) {
595 if (is_null($this->active)) {
597 $data = $this->
raw(self::FIELD_ACTIVE);
598 if (is_null($data)) {
601 $this->active = (bool) $data;
761 #[\ReturnTypeWillChange]
780 return (
object) $data;