commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomerGroupDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class CustomerGroupDraftBuilder implements Builder
24 {
29  private $key;
30 
35  private $groupName;
36 
41  private $custom;
42 
49  public function getKey()
50  {
51  return $this->key;
52  }
53 
61  public function getGroupName()
62  {
63  return $this->groupName;
64  }
65 
72  public function getCustom()
73  {
74  return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
75  }
76 
81  public function withKey(?string $key)
82  {
83  $this->key = $key;
84 
85  return $this;
86  }
87 
92  public function withGroupName(?string $groupName)
93  {
94  $this->groupName = $groupName;
95 
96  return $this;
97  }
98 
103  public function withCustom(?CustomFieldsDraft $custom)
104  {
105  $this->custom = $custom;
106 
107  return $this;
108  }
109 
114  public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
115  {
116  $this->custom = $custom;
117 
118  return $this;
119  }
120 
121  public function build(): CustomerGroupDraft
122  {
123  return new CustomerGroupDraftModel(
124  $this->key,
125  $this->groupName,
126  $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
127  );
128  }
129 
130  public static function of(): CustomerGroupDraftBuilder
131  {
132  return new self();
133  }
134 }