commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ApprovalRuleDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
26  protected $key;
27 
32  protected $name;
33 
38  protected $description;
39 
44  protected $status;
45 
50  protected $predicate;
51 
56  protected $approvers;
57 
62  protected $requesters;
63 
64 
68  public function __construct(
69  ?string $key = null,
70  ?string $name = null,
71  ?string $description = null,
72  ?string $status = null,
73  ?string $predicate = null,
76  ) {
77  $this->key = $key;
78  $this->name = $name;
79  $this->description = $description;
80  $this->status = $status;
81  $this->predicate = $predicate;
82  $this->approvers = $approvers;
83  $this->requesters = $requesters;
84  }
85 
92  public function getKey()
93  {
94  if (is_null($this->key)) {
96  $data = $this->raw(self::FIELD_KEY);
97  if (is_null($data)) {
98  return null;
99  }
100  $this->key = (string) $data;
101  }
102 
103  return $this->key;
104  }
105 
112  public function getName()
113  {
114  if (is_null($this->name)) {
116  $data = $this->raw(self::FIELD_NAME);
117  if (is_null($data)) {
118  return null;
119  }
120  $this->name = (string) $data;
121  }
122 
123  return $this->name;
124  }
125 
132  public function getDescription()
133  {
134  if (is_null($this->description)) {
136  $data = $this->raw(self::FIELD_DESCRIPTION);
137  if (is_null($data)) {
138  return null;
139  }
140  $this->description = (string) $data;
141  }
142 
143  return $this->description;
144  }
145 
152  public function getStatus()
153  {
154  if (is_null($this->status)) {
156  $data = $this->raw(self::FIELD_STATUS);
157  if (is_null($data)) {
158  return null;
159  }
160  $this->status = (string) $data;
161  }
162 
163  return $this->status;
164  }
165 
172  public function getPredicate()
173  {
174  if (is_null($this->predicate)) {
176  $data = $this->raw(self::FIELD_PREDICATE);
177  if (is_null($data)) {
178  return null;
179  }
180  $this->predicate = (string) $data;
181  }
182 
183  return $this->predicate;
184  }
185 
192  public function getApprovers()
193  {
194  if (is_null($this->approvers)) {
196  $data = $this->raw(self::FIELD_APPROVERS);
197  if (is_null($data)) {
198  return null;
199  }
200 
201  $this->approvers = ApproverHierarchyDraftModel::of($data);
202  }
203 
204  return $this->approvers;
205  }
206 
213  public function getRequesters()
214  {
215  if (is_null($this->requesters)) {
217  $data = $this->raw(self::FIELD_REQUESTERS);
218  if (is_null($data)) {
219  return null;
220  }
221  $this->requesters = RuleRequesterDraftCollection::fromArray($data);
222  }
223 
224  return $this->requesters;
225  }
226 
227 
231  public function setKey(?string $key): void
232  {
233  $this->key = $key;
234  }
235 
239  public function setName(?string $name): void
240  {
241  $this->name = $name;
242  }
243 
247  public function setDescription(?string $description): void
248  {
249  $this->description = $description;
250  }
251 
255  public function setStatus(?string $status): void
256  {
257  $this->status = $status;
258  }
259 
263  public function setPredicate(?string $predicate): void
264  {
265  $this->predicate = $predicate;
266  }
267 
272  {
273  $this->approvers = $approvers;
274  }
275 
280  {
281  $this->requesters = $requesters;
282  }
283 }
__construct(?string $key=null, ?string $name=null, ?string $description=null, ?string $status=null, ?string $predicate=null, ?ApproverHierarchyDraft $approvers=null, ?RuleRequesterDraftCollection $requesters=null)