commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ReservationModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class ReservationModel extends JsonObjectModel implements Reservation
21{
22
23
28 protected $quantity;
29
34 protected $owner;
35
40 protected $createdAt;
41
47
48
52 public function __construct(
53 ?int $quantity = null,
54 ?Reference $owner = null,
55 ?string $createdAt = null,
56 ?string $checkoutStartedAt = null
57 ) {
58 $this->quantity = $quantity;
59 $this->owner = $owner;
60 $this->createdAt = $createdAt;
61 $this->checkoutStartedAt = $checkoutStartedAt;
62
63 }
64
69 public function getQuantity()
70 {
71 if (is_null($this->quantity)) {
73 $data = $this->raw(self::FIELD_QUANTITY);
74 if (is_null($data)) {
75 return null;
76 }
77 $this->quantity = (int) $data;
78 }
79
80 return $this->quantity;
81 }
82
89 public function getOwner()
90 {
91 if (is_null($this->owner)) {
93 $data = $this->raw(self::FIELD_OWNER);
94 if (is_null($data)) {
95 return null;
96 }
98 $this->owner = $className::of($data);
99 }
100
101 return $this->owner;
102 }
103
108 public function getCreatedAt()
109 {
110 if (is_null($this->createdAt)) {
112 $data = $this->raw(self::FIELD_CREATED_AT);
113 if (is_null($data)) {
114 return null;
115 }
116 $this->createdAt = (string) $data;
117 }
118
119 return $this->createdAt;
120 }
121
126 public function getCheckoutStartedAt()
127 {
128 if (is_null($this->checkoutStartedAt)) {
130 $data = $this->raw(self::FIELD_CHECKOUT_STARTED_AT);
131 if (is_null($data)) {
132 return null;
133 }
134 $this->checkoutStartedAt = (string) $data;
135 }
136
138 }
139
140
144 public function setQuantity(?int $quantity): void
145 {
146 $this->quantity = $quantity;
147 }
148
152 public function setOwner(?Reference $owner): void
153 {
154 $this->owner = $owner;
155 }
156
160 public function setCreatedAt(?string $createdAt): void
161 {
162 $this->createdAt = $createdAt;
163 }
164
168 public function setCheckoutStartedAt(?string $checkoutStartedAt): void
169 {
170 $this->checkoutStartedAt = $checkoutStartedAt;
171 }
172
173
174
175}
__construct(?int $quantity=null, ?Reference $owner=null, ?string $createdAt=null, ?string $checkoutStartedAt=null)