commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DiscountGroupResourceIdentifierModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'discount-group';
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
61 public function getTypeId()
62 {
63 if (is_null($this->typeId)) {
65 $data = $this->raw(self::FIELD_TYPE_ID);
66 if (is_null($data)) {
67 return null;
68 }
69 $this->typeId = (string) $data;
70 }
71
72 return $this->typeId;
73 }
74
82 public function getId()
83 {
84 if (is_null($this->id)) {
86 $data = $this->raw(self::FIELD_ID);
87 if (is_null($data)) {
88 return null;
89 }
90 $this->id = (string) $data;
91 }
92
93 return $this->id;
94 }
95
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}