commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantBulkUpdateResultModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = '';
27 protected $id;
28
33 protected $key;
34
39 protected $status;
40
45 private static $discriminatorClasses = [
46 'Fail' => VariantBulkUpdateFailResultModel::class,
47 'Success' => VariantBulkUpdateSuccessResultModel::class,
48 ];
49
53 public function __construct(
54 ?string $id = null,
55 ?string $key = null,
56 ?string $status = null
57 ) {
58 $this->id = $id;
59 $this->key = $key;
60 $this->status = $status;
61 }
62
69 public function getId()
70 {
71 if (is_null($this->id)) {
73 $data = $this->raw(self::FIELD_ID);
74 if (is_null($data)) {
75 return null;
76 }
77 $this->id = (string) $data;
78 }
79
80 return $this->id;
81 }
82
89 public function getKey()
90 {
91 if (is_null($this->key)) {
93 $data = $this->raw(self::FIELD_KEY);
94 if (is_null($data)) {
95 return null;
96 }
97 $this->key = (string) $data;
98 }
99
100 return $this->key;
101 }
102
109 public function getStatus()
110 {
111 if (is_null($this->status)) {
113 $data = $this->raw(self::FIELD_STATUS);
114 if (is_null($data)) {
115 return null;
116 }
117 $this->status = (string) $data;
118 }
119
120 return $this->status;
121 }
122
123
127 public function setId(?string $id): void
128 {
129 $this->id = $id;
130 }
131
135 public function setKey(?string $key): void
136 {
137 $this->key = $key;
138 }
139
140
141
146 public static function resolveDiscriminatorClass($value): string
147 {
149 if (is_object($value) && isset($value->$fieldName)) {
151 $discriminatorValue = $value->$fieldName;
152 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
153 return self::$discriminatorClasses[$discriminatorValue];
154 }
155 }
156 if (is_array($value) && isset($value[$fieldName])) {
158 $discriminatorValue = $value[$fieldName];
159 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
160 return self::$discriminatorClasses[$discriminatorValue];
161 }
162 }
163
165 $type = VariantBulkUpdateResultModel::class;
166 return $type;
167 }
168}
__construct(?string $id=null, ?string $key=null, ?string $status=null)