commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Cart
CartReferenceBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Common\Reference
;
12
use
Commercetools\Api\Models\Common\ReferenceBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
CartReferenceBuilder
implements
Builder
24
{
29
private
$id;
30
35
private
$obj;
36
43
public
function
getId
()
44
{
45
return
$this->id;
46
}
47
54
public
function
getObj
()
55
{
56
return
$this->obj instanceof
CartBuilder
? $this->obj->
build
() : $this->obj;
57
}
58
63
public
function
withId
(?
string
$id)
64
{
65
$this->
id
= $id;
66
67
return
$this;
68
}
69
74
public
function
withObj
(?
Cart
$obj)
75
{
76
$this->obj = $obj;
77
78
return
$this;
79
}
80
85
public
function
withObjBuilder
(?
CartBuilder
$obj)
86
{
87
$this->obj = $obj;
88
89
return
$this;
90
}
91
92
public
function
build
():
CartReference
93
{
94
return
new
CartReferenceModel
(
95
$this->
id
,
96
$this->obj instanceof
CartBuilder
? $this->obj->
build
() : $this->obj
97
);
98
}
99
100
public
static
function
of
():
CartReferenceBuilder
101
{
102
return
new
self
();
103
}
104
}
Commercetools\Api\Models\Cart\CartBuilder
Definition:
CartBuilder.php:45
Commercetools\Api\Models\Cart\CartBuilder\build
build()
Definition:
CartBuilder.php:1439
Commercetools\Api\Models\Cart\CartReferenceBuilder
Definition:
CartReferenceBuilder.php:24
Commercetools\Api\Models\Cart\CartReferenceBuilder\build
build()
Definition:
CartReferenceBuilder.php:92
Commercetools\Api\Models\Cart\CartReferenceBuilder\withObjBuilder
withObjBuilder(?CartBuilder $obj)
Definition:
CartReferenceBuilder.php:85
Commercetools\Api\Models\Cart\CartReferenceBuilder\withObj
withObj(?Cart $obj)
Definition:
CartReferenceBuilder.php:74
Commercetools\Api\Models\Cart\CartReferenceBuilder\getId
getId()
Definition:
CartReferenceBuilder.php:43
Commercetools\Api\Models\Cart\CartReferenceBuilder\withId
withId(?string $id)
Definition:
CartReferenceBuilder.php:63
Commercetools\Api\Models\Cart\CartReferenceBuilder\getObj
getObj()
Definition:
CartReferenceBuilder.php:54
Commercetools\Api\Models\Cart\CartReferenceBuilder\of
static of()
Definition:
CartReferenceBuilder.php:100
Commercetools\Api\Models\Cart\CartReferenceModel
Definition:
CartReferenceModel.php:23
Commercetools\Api\Models\Common\ReferenceBuilder
Definition:
ReferenceBuilder.php:92
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Cart\Cart
Definition:
Cart.php:28
Commercetools\Api\Models\Cart\CartReference
Definition:
CartReference.php:16
Commercetools\Api\Models\Common\Reference
Definition:
Reference.php:50
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition:
Cart.php:9
Generated by
1.9.1