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);
202 if (is_null($this->country)) {
204 $data = $this->
raw(self::FIELD_COUNTRY);
205 if (is_null($data)) {
208 $this->country = (string) $data;
223 if (is_null($this->customerGroup)) {
225 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
226 if (is_null($data)) {
230 $this->customerGroup = CustomerGroupKeyReferenceModel::of($data);
245 if (is_null($this->channel)) {
247 $data = $this->
raw(self::FIELD_CHANNEL);
248 if (is_null($data)) {
252 $this->channel = ChannelKeyReferenceModel::of($data);
266 if (is_null($this->validFrom)) {
268 $data = $this->
raw(self::FIELD_VALID_FROM);
269 if (is_null($data)) {
272 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
273 if (
false === $data) {
276 $this->validFrom = $data;
290 if (is_null($this->validUntil)) {
292 $data = $this->
raw(self::FIELD_VALID_UNTIL);
293 if (is_null($data)) {
296 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
297 if (
false === $data) {
300 $this->validUntil = $data;
314 if (is_null($this->tiers)) {
316 $data = $this->
raw(self::FIELD_TIERS);
317 if (is_null($data)) {
320 $this->tiers = PriceTierCollection::fromArray($data);
334 if (is_null($this->discounted)) {
336 $data = $this->
raw(self::FIELD_DISCOUNTED);
337 if (is_null($data)) {
341 $this->discounted = DiscountedPriceModel::of($data);
355 if (is_null($this->custom)) {
357 $data = $this->
raw(self::FIELD_CUSTOM);
358 if (is_null($data)) {
362 $this->custom = CustomModel::of($data);
458 #[\ReturnTypeWillChange]
469 return (
object) $data;