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
72 public function getProductVariant()
73 {
74 if (is_null($this->productVariant)) {
76 $data = $this->raw(self::FIELD_PRODUCT_VARIANT);
77 if (is_null($data)) {
78 return null;
79 }
80
81 $this->productVariant = ProductVariantKeyReferenceModel::of($data);
82 }
83
85 }
86
99 public function getAttributes()
100 {
101 if (is_null($this->attributes)) {
103 $data = $this->raw(self::FIELD_ATTRIBUTES);
104 if (is_null($data)) {
105 return null;
106 }
107
108 $this->attributes = AttributesModel::of($data);
109 }
110
111 return $this->attributes;
112 }
113
120 public function getStaged()
121 {
122 if (is_null($this->staged)) {
124 $data = $this->raw(self::FIELD_STAGED);
125 if (is_null($data)) {
126 return null;
127 }
128 $this->staged = (bool) $data;
129 }
130
131 return $this->staged;
132 }
133
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)