3declare(strict_types=1);
122 if (is_null($this->type)) {
124 $data = $this->
raw(self::FIELD_TYPE);
125 if (is_null($data)) {
128 $this->type = (string) $data;
142 if (is_null($this->product)) {
144 $data = $this->
raw(self::FIELD_PRODUCT);
145 if (is_null($data)) {
149 $this->product = ProductReferenceModel::of($data);
163 if (is_null($this->
id)) {
165 $data = $this->
raw(self::FIELD_ID);
166 if (is_null($data)) {
169 $this->
id = (string) $data;
183 if (is_null($this->variantId)) {
185 $data = $this->
raw(self::FIELD_VARIANT_ID);
186 if (is_null($data)) {
189 $this->variantId = (int) $data;
203 if (is_null($this->key)) {
205 $data = $this->
raw(self::FIELD_KEY);
206 if (is_null($data)) {
209 $this->key = (string) $data;
223 if (is_null($this->sku)) {
225 $data = $this->
raw(self::FIELD_SKU);
226 if (is_null($data)) {
229 $this->sku = (string) $data;
243 if (is_null($this->attributes)) {
245 $data = $this->
raw(self::FIELD_ATTRIBUTES);
246 if (is_null($data)) {
249 $this->attributes = AttributeCollection::fromArray($data);
263 if (is_null($this->assets)) {
265 $data = $this->
raw(self::FIELD_ASSETS);
266 if (is_null($data)) {
269 $this->assets = AssetCollection::fromArray($data);
283 if (is_null($this->images)) {
285 $data = $this->
raw(self::FIELD_IMAGES);
286 if (is_null($data)) {
289 $this->images = ImageCollection::fromArray($data);
303 if (is_null($this->publish)) {
305 $data = $this->
raw(self::FIELD_PUBLISH);
306 if (is_null($data)) {
309 $this->publish = (bool) $data;