commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DiscountGroupDraftModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $name;
29
34 protected $key;
35
40 protected $description;
41
46 protected $sortOrder;
47
52 protected $isActive;
53
54
58 public function __construct(
59 ?LocalizedString $name = null,
60 ?string $key = null,
62 ?string $sortOrder = null,
63 ?bool $isActive = null
64 ) {
65 $this->name = $name;
66 $this->key = $key;
67 $this->description = $description;
68 $this->sortOrder = $sortOrder;
69 $this->isActive = $isActive;
70 }
71
78 public function getName()
79 {
80 if (is_null($this->name)) {
82 $data = $this->raw(self::FIELD_NAME);
83 if (is_null($data)) {
84 return null;
85 }
86
87 $this->name = LocalizedStringModel::of($data);
88 }
89
90 return $this->name;
91 }
92
100 public function getKey()
101 {
102 if (is_null($this->key)) {
104 $data = $this->raw(self::FIELD_KEY);
105 if (is_null($data)) {
106 return null;
107 }
108 $this->key = (string) $data;
109 }
110
111 return $this->key;
112 }
113
120 public function getDescription()
121 {
122 if (is_null($this->description)) {
124 $data = $this->raw(self::FIELD_DESCRIPTION);
125 if (is_null($data)) {
126 return null;
127 }
128
129 $this->description = LocalizedStringModel::of($data);
130 }
131
132 return $this->description;
133 }
134
142 public function getSortOrder()
143 {
144 if (is_null($this->sortOrder)) {
146 $data = $this->raw(self::FIELD_SORT_ORDER);
147 if (is_null($data)) {
148 return null;
149 }
150 $this->sortOrder = (string) $data;
151 }
152
153 return $this->sortOrder;
154 }
155
162 public function getIsActive()
163 {
164 if (is_null($this->isActive)) {
166 $data = $this->raw(self::FIELD_IS_ACTIVE);
167 if (is_null($data)) {
168 return null;
169 }
170 $this->isActive = (bool) $data;
171 }
172
173 return $this->isActive;
174 }
175
176
180 public function setName(?LocalizedString $name): void
181 {
182 $this->name = $name;
183 }
184
188 public function setKey(?string $key): void
189 {
190 $this->key = $key;
191 }
192
197 {
198 $this->description = $description;
199 }
200
204 public function setSortOrder(?string $sortOrder): void
205 {
206 $this->sortOrder = $sortOrder;
207 }
208
212 public function setIsActive(?bool $isActive): void
213 {
214 $this->isActive = $isActive;
215 }
216}
__construct(?LocalizedString $name=null, ?string $key=null, ?LocalizedString $description=null, ?string $sortOrder=null, ?bool $isActive=null)