commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
DuplicateAttributeValuesErrorModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
23  public const DISCRIMINATOR_VALUE = 'DuplicateAttributeValues';
28  protected $code;
29 
34  protected $message;
35 
40  protected $attributes;
41 
42 
46  public function __construct(
47  ?string $message = null,
49  ?string $code = null
50  ) {
51  $this->message = $message;
52  $this->attributes = $attributes;
53  $this->code = $code ?? self::DISCRIMINATOR_VALUE;
54  }
55 
60  public function getCode()
61  {
62  if (is_null($this->code)) {
64  $data = $this->raw(self::FIELD_CODE);
65  if (is_null($data)) {
66  return null;
67  }
68  $this->code = (string) $data;
69  }
70 
71  return $this->code;
72  }
73 
78  public function getMessage()
79  {
80  if (is_null($this->message)) {
82  $data = $this->raw(self::FIELD_MESSAGE);
83  if (is_null($data)) {
84  return null;
85  }
86  $this->message = (string) $data;
87  }
88 
89  return $this->message;
90  }
91 
96  public function getAttributes()
97  {
98  if (is_null($this->attributes)) {
100  $data = $this->raw(self::FIELD_ATTRIBUTES);
101  if (is_null($data)) {
102  return null;
103  }
104  $this->attributes = AttributeCollection::fromArray($data);
105  }
106 
107  return $this->attributes;
108  }
109 
110 
114  public function setMessage(?string $message): void
115  {
116  $this->message = $message;
117  }
118 
123  {
124  $this->attributes = $attributes;
125  }
126 }
__construct(?string $message=null, ?AttributeCollection $attributes=null, ?string $code=null)