commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductVariantPatchModel.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
25{
30 protected $productVariant;
31
36 protected $attributes;
37
42 protected $staged;
43
48 protected $product;
49
50
54 public function __construct(
56 ?Attributes $attributes = null,
57 ?bool $staged = null,
59 ) {
60 $this->productVariant = $productVariant;
61 $this->attributes = $attributes;
62 $this->staged = $staged;
63 $this->product = $product;
64 }
65
73 public function getProductVariant()
74 {
75 if (is_null($this->productVariant)) {
77 $data = $this->raw(self::FIELD_PRODUCT_VARIANT);
78 if (is_null($data)) {
79 return null;
80 }
81
82 $this->productVariant = ProductVariantKeyReferenceModel::of($data);
83 }
84
86 }
87
100 public function getAttributes()
101 {
102 if (is_null($this->attributes)) {
104 $data = $this->raw(self::FIELD_ATTRIBUTES);
105 if (is_null($data)) {
106 return null;
107 }
108
109 $this->attributes = AttributesModel::of($data);
110 }
111
112 return $this->attributes;
113 }
114
121 public function getStaged()
122 {
123 if (is_null($this->staged)) {
125 $data = $this->raw(self::FIELD_STAGED);
126 if (is_null($data)) {
127 return null;
128 }
129 $this->staged = (bool) $data;
130 }
131
132 return $this->staged;
133 }
134
143 public function getProduct()
144 {
145 if (is_null($this->product)) {
147 $data = $this->raw(self::FIELD_PRODUCT);
148 if (is_null($data)) {
149 return null;
150 }
151
152 $this->product = ProductKeyReferenceModel::of($data);
153 }
154
155 return $this->product;
156 }
157
158
163 {
164 $this->productVariant = $productVariant;
165 }
166
170 public function setAttributes(?Attributes $attributes): void
171 {
172 $this->attributes = $attributes;
173 }
174
178 public function setStaged(?bool $staged): void
179 {
180 $this->staged = $staged;
181 }
182
187 {
188 $this->product = $product;
189 }
190}
__construct(?ProductVariantKeyReference $productVariant=null, ?Attributes $attributes=null, ?bool $staged=null, ?ProductKeyReference $product=null)