3declare(strict_types=1);
148 if (is_null($this->key)) {
150 $data = $this->
raw(self::FIELD_KEY);
151 if (is_null($data)) {
154 $this->key = (string) $data;
168 if (is_null($this->sku)) {
170 $data = $this->
raw(self::FIELD_SKU);
171 if (is_null($data)) {
174 $this->sku = (string) $data;
188 if (is_null($this->value)) {
190 $data = $this->
raw(self::FIELD_VALUE);
191 if (is_null($data)) {
194 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
195 $this->value = $className::of($data);
209 if (is_null($this->country)) {
211 $data = $this->
raw(self::FIELD_COUNTRY);
212 if (is_null($data)) {
215 $this->country = (string) $data;
230 if (is_null($this->customerGroup)) {
232 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
233 if (is_null($data)) {
237 $this->customerGroup = CustomerGroupKeyReferenceModel::of($data);
252 if (is_null($this->channel)) {
254 $data = $this->
raw(self::FIELD_CHANNEL);
255 if (is_null($data)) {
259 $this->channel = ChannelKeyReferenceModel::of($data);
273 if (is_null($this->validFrom)) {
275 $data = $this->
raw(self::FIELD_VALID_FROM);
276 if (is_null($data)) {
279 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
280 if (
false === $data) {
283 $this->validFrom = $data;
297 if (is_null($this->validUntil)) {
299 $data = $this->
raw(self::FIELD_VALID_UNTIL);
300 if (is_null($data)) {
303 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
304 if (
false === $data) {
307 $this->validUntil = $data;
321 if (is_null($this->tiers)) {
323 $data = $this->
raw(self::FIELD_TIERS);
324 if (is_null($data)) {
327 $this->tiers = PriceTierCollection::fromArray($data);
341 if (is_null($this->discounted)) {
343 $data = $this->
raw(self::FIELD_DISCOUNTED);
344 if (is_null($data)) {
348 $this->discounted = DiscountedPriceModel::of($data);
362 if (is_null($this->custom)) {
364 $data = $this->
raw(self::FIELD_CUSTOM);
365 if (is_null($data)) {
369 $this->custom = CustomModel::of($data);
384 if (is_null($this->active)) {
386 $data = $this->
raw(self::FIELD_ACTIVE);
387 if (is_null($data)) {
390 $this->active = (bool) $data;
494 #[\ReturnTypeWillChange]
505 return (
object) $data;