commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ReservationReferenceModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'reservation';
29 protected $typeId;
30
35 protected $id;
36
41 protected $obj;
42
43
47 public function __construct(
48 ?string $id = null,
49 ?Reservation $obj = null,
50 ?string $typeId = null
51 ) {
52 $this->id = $id;
53 $this->obj = $obj;
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
81 public function getId()
82 {
83 if (is_null($this->id)) {
85 $data = $this->raw(self::FIELD_ID);
86 if (is_null($data)) {
87 return null;
88 }
89 $this->id = (string) $data;
90 }
91
92 return $this->id;
93 }
94
102 public function getObj()
103 {
104 if (is_null($this->obj)) {
106 $data = $this->raw(self::FIELD_OBJ);
107 if (is_null($data)) {
108 return null;
109 }
110
111 $this->obj = ReservationModel::of($data);
112 }
113
114 return $this->obj;
115 }
116
117
121 public function setId(?string $id): void
122 {
123 $this->id = $id;
124 }
125
129 public function setObj(?Reservation $obj): void
130 {
131 $this->obj = $obj;
132 }
133}
__construct(?string $id=null, ?Reservation $obj=null, ?string $typeId=null)