commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomerGroupDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
28  protected $key;
29 
34  protected $groupName;
35 
40  protected $custom;
41 
42 
46  public function __construct(
47  ?string $key = null,
48  ?string $groupName = null,
50  ) {
51  $this->key = $key;
52  $this->groupName = $groupName;
53  $this->custom = $custom;
54  }
55 
62  public function getKey()
63  {
64  if (is_null($this->key)) {
66  $data = $this->raw(self::FIELD_KEY);
67  if (is_null($data)) {
68  return null;
69  }
70  $this->key = (string) $data;
71  }
72 
73  return $this->key;
74  }
75 
83  public function getGroupName()
84  {
85  if (is_null($this->groupName)) {
87  $data = $this->raw(self::FIELD_GROUP_NAME);
88  if (is_null($data)) {
89  return null;
90  }
91  $this->groupName = (string) $data;
92  }
93 
94  return $this->groupName;
95  }
96 
103  public function getCustom()
104  {
105  if (is_null($this->custom)) {
107  $data = $this->raw(self::FIELD_CUSTOM);
108  if (is_null($data)) {
109  return null;
110  }
111 
112  $this->custom = CustomFieldsDraftModel::of($data);
113  }
114 
115  return $this->custom;
116  }
117 
118 
122  public function setKey(?string $key): void
123  {
124  $this->key = $key;
125  }
126 
130  public function setGroupName(?string $groupName): void
131  {
132  $this->groupName = $groupName;
133  }
134 
138  public function setCustom(?CustomFieldsDraft $custom): void
139  {
140  $this->custom = $custom;
141  }
142 }
__construct(?string $key=null, ?string $groupName=null, ?CustomFieldsDraft $custom=null)