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
81 public function getType()
82 {
83 if (is_null($this->type)) {
85 $data = $this->raw(self::FIELD_TYPE);
86 if (is_null($data)) {
87 return null;
88 }
89 $this->type = (string) $data;
90 }
91
92 return $this->type;
93 }
94
99 public function getValue()
100 {
101 if (is_null($this->value)) {
103 $data = $this->raw(self::FIELD_VALUE);
104 if (is_null($data)) {
105 return null;
106 }
107 $this->value = (string) $data;
108 }
109
110 return $this->value;
111 }
112
113
117 public function setName(?string $name): void
118 {
119 $this->name = $name;
120 }
121
125 public function setValue(?string $value): void
126 {
127 $this->value = $value;
128 }
129}
__construct(?string $name=null, ?string $value=null, ?string $type=null)