commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SearchMatchingVariantModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
26 protected $id;
27
32 protected $sku;
33
34
38 public function __construct(
39 ?int $id = null,
40 ?string $sku = null
41 ) {
42 $this->id = $id;
43 $this->sku = $sku;
44 }
45
52 public function getId()
53 {
54 if (is_null($this->id)) {
56 $data = $this->raw(self::FIELD_ID);
57 if (is_null($data)) {
58 return null;
59 }
60 $this->id = (int) $data;
61 }
62
63 return $this->id;
64 }
65
72 public function getSku()
73 {
74 if (is_null($this->sku)) {
76 $data = $this->raw(self::FIELD_SKU);
77 if (is_null($data)) {
78 return null;
79 }
80 $this->sku = (string) $data;
81 }
82
83 return $this->sku;
84 }
85
86
90 public function setId(?int $id): void
91 {
92 $this->id = $id;
93 }
94
98 public function setSku(?string $sku): void
99 {
100 $this->sku = $sku;
101 }
102}