3declare(strict_types=1);
125 if (is_null($this->
id)) {
127 $data = $this->
raw(self::FIELD_ID);
128 if (is_null($data)) {
131 $this->
id = (string) $data;
145 if (is_null($this->value)) {
147 $data = $this->
raw(self::FIELD_VALUE);
148 if (is_null($data)) {
152 $this->value = $className::of($data);
166 if (is_null($this->currentValue)) {
168 $data = $this->
raw(self::FIELD_CURRENT_VALUE);
169 if (is_null($data)) {
173 $this->currentValue = $className::of($data);
187 if (is_null($this->country)) {
189 $data = $this->
raw(self::FIELD_COUNTRY);
190 if (is_null($data)) {
193 $this->country = (string) $data;
207 if (is_null($this->customerGroup)) {
209 $data = $this->
raw(self::FIELD_CUSTOMER_GROUP);
210 if (is_null($data)) {
214 $this->customerGroup = CustomerGroupReferenceModel::of($data);
228 if (is_null($this->channel)) {
230 $data = $this->
raw(self::FIELD_CHANNEL);
231 if (is_null($data)) {
235 $this->channel = ChannelReferenceModel::of($data);
249 if (is_null($this->validFrom)) {
251 $data = $this->
raw(self::FIELD_VALID_FROM);
252 if (is_null($data)) {
255 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
256 if (
false === $data) {
259 $this->validFrom = $data;
273 if (is_null($this->validUntil)) {
275 $data = $this->
raw(self::FIELD_VALID_UNTIL);
276 if (is_null($data)) {
279 $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
280 if (
false === $data) {
283 $this->validUntil = $data;
298 if (is_null($this->discounted)) {
300 $data = $this->
raw(self::FIELD_DISCOUNTED);
301 if (is_null($data)) {
319 if (is_null($this->custom)) {
321 $data = $this->
raw(self::FIELD_CUSTOM);
322 if (is_null($data)) {
326 $this->custom = CustomFieldsModel::of($data);
414 #[\ReturnTypeWillChange]
425 return (
object) $data;