3declare(strict_types=1);
160 if (is_null($this->key)) {
162 $data = $this->
raw(self::FIELD_KEY);
163 if (is_null($data)) {
166 $this->key = (string) $data;
180 if (is_null($this->value)) {
182 $data = $this->
raw(self::FIELD_VALUE);
183 if (is_null($data)) {
186 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
187 $this->value = $className::of($data);
201 if (is_null($this->country)) {
203 $data = $this->
raw(self::FIELD_COUNTRY);
204 if (is_null($data)) {
207 $this->country = (string) $data;
221 if (is_null($this->validFrom)) {
223 $data = $this->
raw(self::FIELD_VALID_FROM);
224 if (is_null($data)) {
227 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
228 if (
false === $data) {
231 $this->validFrom = $data;
245 if (is_null($this->validUntil)) {
247 $data = $this->
raw(self::FIELD_VALID_UNTIL);
248 if (is_null($data)) {
251 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
252 if (
false === $data) {
255 $this->validUntil = $data;
269 if (is_null($this->customerGroup)) {
271 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
272 if (is_null($data)) {
276 $this->customerGroup = CustomerGroupKeyReferenceModel::of($data);
290 if (is_null($this->channel)) {
292 $data = $this->
raw(self::FIELD_CHANNEL);
293 if (is_null($data)) {
297 $this->channel = ChannelKeyReferenceModel::of($data);
311 if (is_null($this->discounted)) {
313 $data = $this->
raw(self::FIELD_DISCOUNTED);
314 if (is_null($data)) {
318 $this->discounted = DiscountedPriceModel::of($data);
335 if (is_null($this->staged)) {
337 $data = $this->
raw(self::FIELD_STAGED);
338 if (is_null($data)) {
341 $this->staged = (bool) $data;
355 if (is_null($this->tiers)) {
357 $data = $this->
raw(self::FIELD_TIERS);
358 if (is_null($data)) {
361 $this->tiers = PriceTierCollection::fromArray($data);
375 if (is_null($this->custom)) {
377 $data = $this->
raw(self::FIELD_CUSTOM);
378 if (is_null($data)) {
382 $this->custom = CustomModel::of($data);
396 if (is_null($this->productVariant)) {
398 $data = $this->
raw(self::FIELD_PRODUCT_VARIANT);
399 if (is_null($data)) {
403 $this->productVariant = ProductVariantKeyReferenceModel::of($data);
417 if (is_null($this->product)) {
419 $data = $this->
raw(self::FIELD_PRODUCT);
420 if (is_null($data)) {
424 $this->product = ProductKeyReferenceModel::of($data);
536 #[\ReturnTypeWillChange]
547 return (
object) $data;