commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
DuplicateVariantValuesErrorModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'DuplicateVariantValues';
27  protected $code;
28 
33  protected $message;
34 
39  protected $variantValues;
40 
41 
45  public function __construct(
46  ?string $message = null,
48  ?string $code = null
49  ) {
50  $this->message = $message;
51  $this->variantValues = $variantValues;
52  $this->code = $code ?? self::DISCRIMINATOR_VALUE;
53  }
54 
59  public function getCode()
60  {
61  if (is_null($this->code)) {
63  $data = $this->raw(self::FIELD_CODE);
64  if (is_null($data)) {
65  return null;
66  }
67  $this->code = (string) $data;
68  }
69 
70  return $this->code;
71  }
72 
77  public function getMessage()
78  {
79  if (is_null($this->message)) {
81  $data = $this->raw(self::FIELD_MESSAGE);
82  if (is_null($data)) {
83  return null;
84  }
85  $this->message = (string) $data;
86  }
87 
88  return $this->message;
89  }
90 
97  public function getVariantValues()
98  {
99  if (is_null($this->variantValues)) {
101  $data = $this->raw(self::FIELD_VARIANT_VALUES);
102  if (is_null($data)) {
103  return null;
104  }
105 
106  $this->variantValues = VariantValuesModel::of($data);
107  }
108 
109  return $this->variantValues;
110  }
111 
112 
116  public function setMessage(?string $message): void
117  {
118  $this->message = $message;
119  }
120 
125  {
126  $this->variantValues = $variantValues;
127  }
128 }
__construct(?string $message=null, ?VariantValues $variantValues=null, ?string $code=null)