commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
Common
ReservationModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Common
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
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
135
return
$this->checkoutStartedAt
;
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
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\History\Models\Common\ReservationModel
Definition
ReservationModel.php:21
Commercetools\History\Models\Common\ReservationModel\$createdAt
$createdAt
Definition
ReservationModel.php:40
Commercetools\History\Models\Common\ReservationModel\setCreatedAt
setCreatedAt(?string $createdAt)
Definition
ReservationModel.php:158
Commercetools\History\Models\Common\ReservationModel\$quantity
$quantity
Definition
ReservationModel.php:28
Commercetools\History\Models\Common\ReservationModel\setOwner
setOwner(?Reference $owner)
Definition
ReservationModel.php:150
Commercetools\History\Models\Common\ReservationModel\$owner
$owner
Definition
ReservationModel.php:34
Commercetools\History\Models\Common\ReservationModel\getCreatedAt
getCreatedAt()
Definition
ReservationModel.php:106
Commercetools\History\Models\Common\ReservationModel\getQuantity
getQuantity()
Definition
ReservationModel.php:69
Commercetools\History\Models\Common\ReservationModel\setCheckoutStartedAt
setCheckoutStartedAt(?string $checkoutStartedAt)
Definition
ReservationModel.php:166
Commercetools\History\Models\Common\ReservationModel\$checkoutStartedAt
$checkoutStartedAt
Definition
ReservationModel.php:46
Commercetools\History\Models\Common\ReservationModel\setQuantity
setQuantity(?int $quantity)
Definition
ReservationModel.php:142
Commercetools\History\Models\Common\ReservationModel\__construct
__construct(?int $quantity=null, ?Reference $owner=null, ?string $createdAt=null, ?string $checkoutStartedAt=null)
Definition
ReservationModel.php:52
Commercetools\History\Models\Common\ReservationModel\getOwner
getOwner()
Definition
ReservationModel.php:87
Commercetools\History\Models\Common\ReservationModel\getCheckoutStartedAt
getCheckoutStartedAt()
Definition
ReservationModel.php:124
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Common\Reference
Definition
Reference.php:15
Commercetools\History\Models\Common\Reservation
Definition
Reservation.php:15
Commercetools\History\Models\Common
Definition
Address.php:9
Generated by
1.9.8