commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Common
ReservationBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Common
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
ReservationBuilder
implements
Builder
22
{
27
private
$quantity;
28
33
private
$owner;
34
39
private
$createdAt;
40
45
private
$checkoutStartedAt;
46
51
public
function
getQuantity
()
52
{
53
return
$this->quantity;
54
}
55
60
public
function
getOwner
()
61
{
62
return
$this->owner instanceof
ReferenceBuilder
? $this->owner->
build
() : $this->owner;
63
}
64
69
public
function
getCreatedAt
()
70
{
71
return
$this->createdAt;
72
}
73
78
public
function
getCheckoutStartedAt
()
79
{
80
return
$this->checkoutStartedAt;
81
}
82
87
public
function
withQuantity
(?
int
$quantity)
88
{
89
$this->quantity = $quantity;
90
91
return
$this;
92
}
93
98
public
function
withOwner
(?
Reference
$owner)
99
{
100
$this->owner = $owner;
101
102
return
$this;
103
}
104
109
public
function
withCreatedAt
(?
string
$createdAt)
110
{
111
$this->createdAt = $createdAt;
112
113
return
$this;
114
}
115
120
public
function
withCheckoutStartedAt
(?
string
$checkoutStartedAt)
121
{
122
$this->checkoutStartedAt = $checkoutStartedAt;
123
124
return
$this;
125
}
126
131
public
function
withOwnerBuilder
(?
ReferenceBuilder
$owner)
132
{
133
$this->owner = $owner;
134
135
return
$this;
136
}
137
138
public
function
build
():
Reservation
139
{
140
return
new
ReservationModel
(
141
$this->quantity,
142
$this->owner instanceof
ReferenceBuilder
? $this->owner->
build
() : $this->owner,
143
$this->createdAt,
144
$this->checkoutStartedAt
145
);
146
}
147
148
public
static
function
of
():
ReservationBuilder
149
{
150
return
new
self
();
151
}
152
}
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\ReferenceBuilder
Definition:
ReferenceBuilder.php:22
Commercetools\History\Models\Common\ReferenceBuilder\build
build()
Definition:
ReferenceBuilder.php:76
Commercetools\History\Models\Common\ReservationBuilder
Definition:
ReservationBuilder.php:22
Commercetools\History\Models\Common\ReservationBuilder\withCreatedAt
withCreatedAt(?string $createdAt)
Definition:
ReservationBuilder.php:109
Commercetools\History\Models\Common\ReservationBuilder\getCheckoutStartedAt
getCheckoutStartedAt()
Definition:
ReservationBuilder.php:78
Commercetools\History\Models\Common\ReservationBuilder\of
static of()
Definition:
ReservationBuilder.php:148
Commercetools\History\Models\Common\ReservationBuilder\withOwnerBuilder
withOwnerBuilder(?ReferenceBuilder $owner)
Definition:
ReservationBuilder.php:131
Commercetools\History\Models\Common\ReservationBuilder\withOwner
withOwner(?Reference $owner)
Definition:
ReservationBuilder.php:98
Commercetools\History\Models\Common\ReservationBuilder\withQuantity
withQuantity(?int $quantity)
Definition:
ReservationBuilder.php:87
Commercetools\History\Models\Common\ReservationBuilder\withCheckoutStartedAt
withCheckoutStartedAt(?string $checkoutStartedAt)
Definition:
ReservationBuilder.php:120
Commercetools\History\Models\Common\ReservationBuilder\getOwner
getOwner()
Definition:
ReservationBuilder.php:60
Commercetools\History\Models\Common\ReservationBuilder\getQuantity
getQuantity()
Definition:
ReservationBuilder.php:51
Commercetools\History\Models\Common\ReservationBuilder\getCreatedAt
getCreatedAt()
Definition:
ReservationBuilder.php:69
Commercetools\History\Models\Common\ReservationBuilder\build
build()
Definition:
ReservationBuilder.php:138
Commercetools\History\Models\Common\ReservationModel
Definition:
ReservationModel.php:21
Commercetools\Base\Builder
Definition:
Builder.php:16
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.1