commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ReservationModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class ReservationModel extends JsonObjectModel implements Reservation
21 {
22 
23 
28  protected $quantity;
29 
34  protected $owner;
35 
40  protected $createdAt;
41 
46  protected $checkoutStartedAt;
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 
87  public function getOwner()
88  {
89  if (is_null($this->owner)) {
91  $data = $this->raw(self::FIELD_OWNER);
92  if (is_null($data)) {
93  return null;
94  }
95 
96  $this->owner = ReferenceModel::of($data);
97  }
98 
99  return $this->owner;
100  }
101 
106  public function getCreatedAt()
107  {
108  if (is_null($this->createdAt)) {
110  $data = $this->raw(self::FIELD_CREATED_AT);
111  if (is_null($data)) {
112  return null;
113  }
114  $this->createdAt = (string) $data;
115  }
116 
117  return $this->createdAt;
118  }
119 
124  public function getCheckoutStartedAt()
125  {
126  if (is_null($this->checkoutStartedAt)) {
128  $data = $this->raw(self::FIELD_CHECKOUT_STARTED_AT);
129  if (is_null($data)) {
130  return null;
131  }
132  $this->checkoutStartedAt = (string) $data;
133  }
134 
136  }
137 
138 
142  public function setQuantity(?int $quantity): void
143  {
144  $this->quantity = $quantity;
145  }
146 
150  public function setOwner(?Reference $owner): void
151  {
152  $this->owner = $owner;
153  }
154 
158  public function setCreatedAt(?string $createdAt): void
159  {
160  $this->createdAt = $createdAt;
161  }
162 
166  public function setCheckoutStartedAt(?string $checkoutStartedAt): void
167  {
168  $this->checkoutStartedAt = $checkoutStartedAt;
169  }
170 
171 
172 
173 }
__construct(?int $quantity=null, ?Reference $owner=null, ?string $createdAt=null, ?string $checkoutStartedAt=null)