commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StateResourceIdentifierModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'state';
29 protected $typeId;
30
35 protected $id;
36
41 protected $key;
42
43
47 public function __construct(
48 ?string $id = null,
49 ?string $key = null,
50 ?string $typeId = null
51 ) {
52 $this->id = $id;
53 $this->key = $key;
54 $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE;
55 }
56
63 public function getTypeId()
64 {
65 if (is_null($this->typeId)) {
67 $data = $this->raw(self::FIELD_TYPE_ID);
68 if (is_null($data)) {
69 return null;
70 }
71 $this->typeId = (string) $data;
72 }
73
74 return $this->typeId;
75 }
76
83 public function getId()
84 {
85 if (is_null($this->id)) {
87 $data = $this->raw(self::FIELD_ID);
88 if (is_null($data)) {
89 return null;
90 }
91 $this->id = (string) $data;
92 }
93
94 return $this->id;
95 }
96
103 public function getKey()
104 {
105 if (is_null($this->key)) {
107 $data = $this->raw(self::FIELD_KEY);
108 if (is_null($data)) {
109 return null;
110 }
111 $this->key = (string) $data;
112 }
113
114 return $this->key;
115 }
116
117
121 public function setId(?string $id): void
122 {
123 $this->id = $id;
124 }
125
129 public function setKey(?string $key): void
130 {
131 $this->key = $key;
132 }
133}
__construct(?string $id=null, ?string $key=null, ?string $typeId=null)