commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomObjectDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
26  protected $container;
27 
32  protected $key;
33 
38  protected $value;
39 
44  protected $version;
45 
46 
50  public function __construct(
51  ?string $container = null,
52  ?string $key = null,
53  $value = null,
54  ?int $version = null
55  ) {
56  $this->container = $container;
57  $this->key = $key;
58  $this->value = $value;
59  $this->version = $version;
60  }
61 
68  public function getContainer()
69  {
70  if (is_null($this->container)) {
72  $data = $this->raw(self::FIELD_CONTAINER);
73  if (is_null($data)) {
74  return null;
75  }
76  $this->container = (string) $data;
77  }
78 
79  return $this->container;
80  }
81 
88  public function getKey()
89  {
90  if (is_null($this->key)) {
92  $data = $this->raw(self::FIELD_KEY);
93  if (is_null($data)) {
94  return null;
95  }
96  $this->key = (string) $data;
97  }
98 
99  return $this->key;
100  }
101 
112  public function getValue()
113  {
114  if (is_null($this->value)) {
116  $data = $this->raw(self::FIELD_VALUE);
117  if (is_null($data)) {
118  return null;
119  }
120  $this->value = $data;
121  }
122 
123  return $this->value;
124  }
125 
132  public function getVersion()
133  {
134  if (is_null($this->version)) {
136  $data = $this->raw(self::FIELD_VERSION);
137  if (is_null($data)) {
138  return null;
139  }
140  $this->version = (int) $data;
141  }
142 
143  return $this->version;
144  }
145 
146 
150  public function setContainer(?string $container): void
151  {
152  $this->container = $container;
153  }
154 
158  public function setKey(?string $key): void
159  {
160  $this->key = $key;
161  }
162 
166  public function setValue($value): void
167  {
168  $this->value = $value;
169  }
170 
174  public function setVersion(?int $version): void
175  {
176  $this->version = $version;
177  }
178 }
__construct(?string $container=null, ?string $key=null, $value=null, ?int $version=null)