3declare(strict_types=1);
125 if (is_null($this->key)) {
127 $data = $this->
raw(self::FIELD_KEY);
128 if (is_null($data)) {
131 $this->key = (string) $data;
146 if (is_null($this->value)) {
148 $data = $this->
raw(self::FIELD_VALUE);
149 if (is_null($data)) {
167 if (is_null($this->country)) {
169 $data = $this->
raw(self::FIELD_COUNTRY);
170 if (is_null($data)) {
173 $this->country = (string) $data;
187 if (is_null($this->customerGroup)) {
189 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
190 if (is_null($data)) {
194 $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data);
208 if (is_null($this->channel)) {
210 $data = $this->
raw(self::FIELD_CHANNEL);
211 if (is_null($data)) {
215 $this->channel = ChannelResourceIdentifierModel::of($data);
229 if (is_null($this->validFrom)) {
231 $data = $this->
raw(self::FIELD_VALID_FROM);
232 if (is_null($data)) {
235 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
236 if (
false === $data) {
239 $this->validFrom = $data;
253 if (is_null($this->validUntil)) {
255 $data = $this->
raw(self::FIELD_VALID_UNTIL);
256 if (is_null($data)) {
259 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
260 if (
false === $data) {
263 $this->validUntil = $data;
284 if (is_null($this->discounted)) {
286 $data = $this->
raw(self::FIELD_DISCOUNTED);
287 if (is_null($data)) {
306 if (is_null($this->tiers)) {
308 $data = $this->
raw(self::FIELD_TIERS);
309 if (is_null($data)) {
326 if (is_null($this->custom)) {
328 $data = $this->
raw(self::FIELD_CUSTOM);
329 if (is_null($data)) {
333 $this->custom = CustomFieldsDraftModel::of($data);
421 #[\ReturnTypeWillChange]
432 return (
object) $data;