commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomObjectDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class CustomObjectDraftBuilder implements Builder
22 {
27  private $container;
28 
33  private $key;
34 
39  private $value;
40 
45  private $version;
46 
53  public function getContainer()
54  {
55  return $this->container;
56  }
57 
64  public function getKey()
65  {
66  return $this->key;
67  }
68 
79  public function getValue()
80  {
81  return $this->value;
82  }
83 
90  public function getVersion()
91  {
92  return $this->version;
93  }
94 
99  public function withContainer(?string $container)
100  {
101  $this->container = $container;
102 
103  return $this;
104  }
105 
110  public function withKey(?string $key)
111  {
112  $this->key = $key;
113 
114  return $this;
115  }
116 
121  public function withValue($value)
122  {
123  $this->value = $value;
124 
125  return $this;
126  }
127 
132  public function withVersion(?int $version)
133  {
134  $this->version = $version;
135 
136  return $this;
137  }
138 
139 
140  public function build(): CustomObjectDraft
141  {
142  return new CustomObjectDraftModel(
143  $this->container,
144  $this->key,
145  $this->value,
146  $this->version
147  );
148  }
149 
150  public static function of(): CustomObjectDraftBuilder
151  {
152  return new self();
153  }
154 }