commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
LocalizableEnumAttributeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'lenum';
27 protected $name;
28
33 protected $type;
34
39 protected $value;
40
41
45 public function __construct(
46 ?string $name = null,
47 ?string $value = null,
48 ?string $type = null
49 ) {
50 $this->name = $name;
51 $this->value = $value;
52 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
53 }
54
63 public function getName()
64 {
65 if (is_null($this->name)) {
67 $data = $this->raw(self::FIELD_NAME);
68 if (is_null($data)) {
69 return null;
70 }
71 $this->name = (string) $data;
72 }
73
74 return $this->name;
75 }
76
85 public function getType()
86 {
87 if (is_null($this->type)) {
89 $data = $this->raw(self::FIELD_TYPE);
90 if (is_null($data)) {
91 return null;
92 }
93 $this->type = (string) $data;
94 }
95
96 return $this->type;
97 }
98
106 public function getValue()
107 {
108 if (is_null($this->value)) {
110 $data = $this->raw(self::FIELD_VALUE);
111 if (is_null($data)) {
112 return null;
113 }
114 $this->value = (string) $data;
115 }
116
117 return $this->value;
118 }
119
120
124 public function setName(?string $name): void
125 {
126 $this->name = $name;
127 }
128
132 public function setValue(?string $value): void
133 {
134 $this->value = $value;
135 }
136}
__construct(?string $name=null, ?string $value=null, ?string $type=null)