3declare(strict_types=1);
140 if (is_null($this->key)) {
142 $data = $this->
raw(self::FIELD_KEY);
143 if (is_null($data)) {
146 $this->key = (string) $data;
160 if (is_null($this->sku)) {
162 $data = $this->
raw(self::FIELD_SKU);
163 if (is_null($data)) {
166 $this->sku = (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;
222 if (is_null($this->customerGroup)) {
224 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
225 if (is_null($data)) {
229 $this->customerGroup = CustomerGroupKeyReferenceModel::of($data);
244 if (is_null($this->channel)) {
246 $data = $this->
raw(self::FIELD_CHANNEL);
247 if (is_null($data)) {
251 $this->channel = ChannelKeyReferenceModel::of($data);
265 if (is_null($this->validFrom)) {
267 $data = $this->
raw(self::FIELD_VALID_FROM);
268 if (is_null($data)) {
271 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
272 if (
false === $data) {
275 $this->validFrom = $data;
289 if (is_null($this->validUntil)) {
291 $data = $this->
raw(self::FIELD_VALID_UNTIL);
292 if (is_null($data)) {
295 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
296 if (
false === $data) {
299 $this->validUntil = $data;
313 if (is_null($this->tiers)) {
315 $data = $this->
raw(self::FIELD_TIERS);
316 if (is_null($data)) {
319 $this->tiers = PriceTierCollection::fromArray($data);
333 if (is_null($this->discounted)) {
335 $data = $this->
raw(self::FIELD_DISCOUNTED);
336 if (is_null($data)) {
340 $this->discounted = DiscountedPriceModel::of($data);
354 if (is_null($this->custom)) {
356 $data = $this->
raw(self::FIELD_CUSTOM);
357 if (is_null($data)) {
361 $this->custom = CustomModel::of($data);
457 #[\ReturnTypeWillChange]
468 return (
object) $data;