commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantAttributesAttributeMetadataModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $name;
29
34 protected $label;
35
40 protected $type;
41
42
46 public function __construct(
47 ?string $name = null,
48 ?LocalizedString $label = null,
49 ?string $type = null
50 ) {
51 $this->name = $name;
52 $this->label = $label;
53 $this->type = $type;
54 }
55
62 public function getName()
63 {
64 if (is_null($this->name)) {
66 $data = $this->raw(self::FIELD_NAME);
67 if (is_null($data)) {
68 return null;
69 }
70 $this->name = (string) $data;
71 }
72
73 return $this->name;
74 }
75
83 public function getLabel()
84 {
85 if (is_null($this->label)) {
87 $data = $this->raw(self::FIELD_LABEL);
88 if (is_null($data)) {
89 return null;
90 }
91
92 $this->label = LocalizedStringModel::of($data);
93 }
94
95 return $this->label;
96 }
97
104 public function getType()
105 {
106 if (is_null($this->type)) {
108 $data = $this->raw(self::FIELD_TYPE);
109 if (is_null($data)) {
110 return null;
111 }
112 $this->type = (string) $data;
113 }
114
115 return $this->type;
116 }
117
118
122 public function setName(?string $name): void
123 {
124 $this->name = $name;
125 }
126
130 public function setLabel(?LocalizedString $label): void
131 {
132 $this->label = $label;
133 }
134
138 public function setType(?string $type): void
139 {
140 $this->type = $type;
141 }
142}