3declare(strict_types=1);
128 if (is_null($this->value)) {
130 $data = $this->
raw(self::FIELD_VALUE);
131 if (is_null($data)) {
134 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
135 $this->value = $className::of($data);
149 if (is_null($this->country)) {
151 $data = $this->
raw(self::FIELD_COUNTRY);
152 if (is_null($data)) {
155 $this->country = (string) $data;
169 if (is_null($this->customerGroup)) {
171 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
172 if (is_null($data)) {
176 $this->customerGroup = CustomerGroupKeyReferenceModel::of($data);
190 if (is_null($this->channel)) {
192 $data = $this->
raw(self::FIELD_CHANNEL);
193 if (is_null($data)) {
197 $this->channel = ChannelKeyReferenceModel::of($data);
209 if (is_null($this->validFrom)) {
211 $data = $this->
raw(self::FIELD_VALID_FROM);
212 if (is_null($data)) {
215 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
216 if (
false === $data) {
219 $this->validFrom = $data;
231 if (is_null($this->validUntil)) {
233 $data = $this->
raw(self::FIELD_VALID_UNTIL);
234 if (is_null($data)) {
237 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
238 if (
false === $data) {
241 $this->validUntil = $data;
255 if (is_null($this->custom)) {
257 $data = $this->
raw(self::FIELD_CUSTOM);
258 if (is_null($data)) {
262 $this->custom = CustomModel::of($data);
276 if (is_null($this->discounted)) {
278 $data = $this->
raw(self::FIELD_DISCOUNTED);
279 if (is_null($data)) {
283 $this->discounted = DiscountedPriceModel::of($data);
297 if (is_null($this->tiers)) {
299 $data = $this->
raw(self::FIELD_TIERS);
300 if (is_null($data)) {
303 $this->tiers = PriceTierCollection::fromArray($data);
317 if (is_null($this->key)) {
319 $data = $this->
raw(self::FIELD_KEY);
320 if (is_null($data)) {
323 $this->key = (string) $data;
411 #[\ReturnTypeWillChange]
422 return (
object) $data;