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
99 public function getKey()
100 {
101 if (is_null($this->key)) {
103 $data = $this->raw(self::FIELD_KEY);
104 if (is_null($data)) {
105 return null;
106 }
107 $this->key = (string) $data;
108 }
109
110 return $this->key;
111 }
112
119 public function getDescription()
120 {
121 if (is_null($this->description)) {
123 $data = $this->raw(self::FIELD_DESCRIPTION);
124 if (is_null($data)) {
125 return null;
126 }
127
128 $this->description = LocalizedStringModel::of($data);
129 }
130
131 return $this->description;
132 }
133
141 public function getSortOrder()
142 {
143 if (is_null($this->sortOrder)) {
145 $data = $this->raw(self::FIELD_SORT_ORDER);
146 if (is_null($data)) {
147 return null;
148 }
149 $this->sortOrder = (string) $data;
150 }
151
152 return $this->sortOrder;
153 }
154
161 public function getIsActive()
162 {
163 if (is_null($this->isActive)) {
165 $data = $this->raw(self::FIELD_IS_ACTIVE);
166 if (is_null($data)) {
167 return null;
168 }
169 $this->isActive = (bool) $data;
170 }
171
172 return $this->isActive;
173 }
174
175
179 public function setName(?LocalizedString $name): void
180 {
181 $this->name = $name;
182 }
183
187 public function setKey(?string $key): void
188 {
189 $this->key = $key;
190 }
191
196 {
197 $this->description = $description;
198 }
199
203 public function setSortOrder(?string $sortOrder): void
204 {
205 $this->sortOrder = $sortOrder;
206 }
207
211 public function setIsActive(?bool $isActive): void
212 {
213 $this->isActive = $isActive;
214 }
215}
__construct(?LocalizedString $name=null, ?string $key=null, ?LocalizedString $description=null, ?string $sortOrder=null, ?bool $isActive=null)