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
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
84 public function getId()
85 {
86 if (is_null($this->id)) {
88 $data = $this->raw(self::FIELD_ID);
89 if (is_null($data)) {
90 return null;
91 }
92 $this->id = (string) $data;
93 }
94
95 return $this->id;
96 }
97
105 public function getKey()
106 {
107 if (is_null($this->key)) {
109 $data = $this->raw(self::FIELD_KEY);
110 if (is_null($data)) {
111 return null;
112 }
113 $this->key = (string) $data;
114 }
115
116 return $this->key;
117 }
118
119
123 public function setId(?string $id): void
124 {
125 $this->id = $id;
126 }
127
131 public function setKey(?string $key): void
132 {
133 $this->key = $key;
134 }
135}