commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomObjectKeyReferenceModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'key-value-document';
27 protected $key;
28
33 protected $typeId;
34
39 protected $container;
40
41
45 public function __construct(
46 ?string $key = null,
47 ?string $container = null,
48 ?string $typeId = null
49 ) {
50 $this->key = $key;
51 $this->container = $container;
52 $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE;
53 }
54
61 public function getKey()
62 {
63 if (is_null($this->key)) {
65 $data = $this->raw(self::FIELD_KEY);
66 if (is_null($data)) {
67 return null;
68 }
69 $this->key = (string) $data;
70 }
71
72 return $this->key;
73 }
74
81 public function getTypeId()
82 {
83 if (is_null($this->typeId)) {
85 $data = $this->raw(self::FIELD_TYPE_ID);
86 if (is_null($data)) {
87 return null;
88 }
89 $this->typeId = (string) $data;
90 }
91
92 return $this->typeId;
93 }
94
101 public function getContainer()
102 {
103 if (is_null($this->container)) {
105 $data = $this->raw(self::FIELD_CONTAINER);
106 if (is_null($data)) {
107 return null;
108 }
109 $this->container = (string) $data;
110 }
111
112 return $this->container;
113 }
114
115
119 public function setKey(?string $key): void
120 {
121 $this->key = $key;
122 }
123
127 public function setContainer(?string $container): void
128 {
129 $this->container = $container;
130 }
131}
__construct(?string $key=null, ?string $container=null, ?string $typeId=null)