3declare(strict_types=1);
154 if (is_null($this->key)) {
156 $data = $this->
raw(self::FIELD_KEY);
157 if (is_null($data)) {
160 $this->key = (string) $data;
175 if (is_null($this->sku)) {
177 $data = $this->
raw(self::FIELD_SKU);
178 if (is_null($data)) {
181 $this->sku = (string) $data;
196 if (is_null($this->value)) {
198 $data = $this->
raw(self::FIELD_VALUE);
199 if (is_null($data)) {
203 $this->value = MoneyModel::of($data);
217 if (is_null($this->country)) {
219 $data = $this->
raw(self::FIELD_COUNTRY);
220 if (is_null($data)) {
223 $this->country = (string) $data;
237 if (is_null($this->customerGroup)) {
239 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
240 if (is_null($data)) {
244 $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data);
258 if (is_null($this->channel)) {
260 $data = $this->
raw(self::FIELD_CHANNEL);
261 if (is_null($data)) {
265 $this->channel = ChannelResourceIdentifierModel::of($data);
279 if (is_null($this->validFrom)) {
281 $data = $this->
raw(self::FIELD_VALID_FROM);
282 if (is_null($data)) {
285 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
286 if (
false === $data) {
289 $this->validFrom = $data;
303 if (is_null($this->validUntil)) {
305 $data = $this->
raw(self::FIELD_VALID_UNTIL);
306 if (is_null($data)) {
309 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
310 if (
false === $data) {
313 $this->validUntil = $data;
328 if (is_null($this->tiers)) {
330 $data = $this->
raw(self::FIELD_TIERS);
331 if (is_null($data)) {
334 $this->tiers = PriceTierDraftCollection::fromArray($data);
348 if (is_null($this->discounted)) {
350 $data = $this->
raw(self::FIELD_DISCOUNTED);
351 if (is_null($data)) {
355 $this->discounted = DiscountedPriceDraftModel::of($data);
369 if (is_null($this->custom)) {
371 $data = $this->
raw(self::FIELD_CUSTOM);
372 if (is_null($data)) {
376 $this->custom = CustomFieldsDraftModel::of($data);
390 if (is_null($this->staged)) {
392 $data = $this->
raw(self::FIELD_STAGED);
393 if (is_null($data)) {
411 if (is_null($this->active)) {
413 $data = $this->
raw(self::FIELD_ACTIVE);
414 if (is_null($data)) {
417 $this->active = (bool) $data;
529 #[\ReturnTypeWillChange]
540 return (
object) $data;