commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DirectDiscountDraftModel.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
25{
30 protected $value;
31
36 protected $target;
37
43
44
48 public function __construct(
52 ) {
53 $this->value = $value;
54 $this->target = $target;
55 $this->participateInBestDealSelection = $participateInBestDealSelection;
56 }
57
64 public function getValue()
65 {
66 if (is_null($this->value)) {
68 $data = $this->raw(self::FIELD_VALUE);
69 if (is_null($data)) {
70 return null;
71 }
73 $this->value = $className::of($data);
74 }
75
76 return $this->value;
77 }
78
86 public function getTarget()
87 {
88 if (is_null($this->target)) {
90 $data = $this->raw(self::FIELD_TARGET);
91 if (is_null($data)) {
92 return null;
93 }
94 $className = CartDiscountTargetModel::resolveDiscriminatorClass($data);
95 $this->target = $className::of($data);
96 }
97
98 return $this->target;
99 }
100
112 {
113 if (is_null($this->participateInBestDealSelection)) {
115 $data = $this->raw(self::FIELD_PARTICIPATE_IN_BEST_DEAL_SELECTION);
116 if (is_null($data)) {
117 return null;
118 }
119 $this->participateInBestDealSelection = (bool) $data;
120 }
121
123 }
124
125
129 public function setValue(?CartDiscountValueDraft $value): void
130 {
131 $this->value = $value;
132 }
133
137 public function setTarget(?CartDiscountTarget $target): void
138 {
139 $this->target = $target;
140 }
141
146 {
147 $this->participateInBestDealSelection = $participateInBestDealSelection;
148 }
149}
setParticipateInBestDealSelection(?bool $participateInBestDealSelection)
__construct(?CartDiscountValueDraft $value=null, ?CartDiscountTarget $target=null, ?bool $participateInBestDealSelection=null)