3declare(strict_types=1);
122 if (is_null($this->value)) {
124 $data = $this->
raw(self::FIELD_VALUE);
125 if (is_null($data)) {
128 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
129 $this->value = $className::of($data);
143 if (is_null($this->country)) {
145 $data = $this->
raw(self::FIELD_COUNTRY);
146 if (is_null($data)) {
149 $this->country = (string) $data;
163 if (is_null($this->validFrom)) {
165 $data = $this->
raw(self::FIELD_VALID_FROM);
166 if (is_null($data)) {
169 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
170 if (
false === $data) {
173 $this->validFrom = $data;
187 if (is_null($this->validUntil)) {
189 $data = $this->
raw(self::FIELD_VALID_UNTIL);
190 if (is_null($data)) {
193 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
194 if (
false === $data) {
197 $this->validUntil = $data;
211 if (is_null($this->customerGroup)) {
213 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
214 if (is_null($data)) {
218 $this->customerGroup = CustomerGroupKeyReferenceModel::of($data);
232 if (is_null($this->channel)) {
234 $data = $this->
raw(self::FIELD_CHANNEL);
235 if (is_null($data)) {
239 $this->channel = ChannelKeyReferenceModel::of($data);
253 if (is_null($this->discounted)) {
255 $data = $this->
raw(self::FIELD_DISCOUNTED);
256 if (is_null($data)) {
274 if (is_null($this->tiers)) {
276 $data = $this->
raw(self::FIELD_TIERS);
277 if (is_null($data)) {
280 $this->tiers = PriceTierCollection::fromArray($data);
294 if (is_null($this->custom)) {
296 $data = $this->
raw(self::FIELD_CUSTOM);
297 if (is_null($data)) {
301 $this->custom = CustomModel::of($data);
381 #[\ReturnTypeWillChange]
392 return (
object) $data;