commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ParameterOverrideBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class ParameterOverrideBuilder implements Builder
22{
27 private $name;
28
33 private $description;
34
39 private $const;
40
45 private $default;
46
51 private $allowedTypes;
52
59 public function getName()
60 {
61 return $this->name;
62 }
63
70 public function getDescription()
71 {
72 return $this->description;
73 }
74
81 public function getConst()
82 {
83 return $this->const;
84 }
85
92 public function getDefault()
93 {
94 return $this->default;
95 }
96
103 public function getAllowedTypes()
104 {
105 return $this->allowedTypes;
106 }
107
112 public function withName(?string $name)
113 {
114 $this->name = $name;
115
116 return $this;
117 }
118
123 public function withDescription(?string $description)
124 {
125 $this->description = $description;
126
127 return $this;
128 }
129
134 public function withConst($const)
135 {
136 $this->const = $const;
137
138 return $this;
139 }
140
145 public function withDefault($default)
146 {
147 $this->default = $default;
148
149 return $this;
150 }
151
156 public function withAllowedTypes(?array $allowedTypes)
157 {
158 $this->allowedTypes = $allowedTypes;
159
160 return $this;
161 }
162
163
164 public function build(): ParameterOverride
165 {
166 return new ParameterOverrideModel(
167 $this->name,
168 $this->description,
169 $this->const,
170 $this->default,
171 $this->allowedTypes
172 );
173 }
174
175 public static function of(): ParameterOverrideBuilder
176 {
177 return new self();
178 }
179}