commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Me
ReplicaMyCartDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Me
;
10
11
use
Commercetools\Api\Models\Cart\CartReference
;
12
use
Commercetools\Api\Models\Cart\CartReferenceModel
;
13
use
Commercetools\Api\Models\Order\OrderReference
;
14
use
Commercetools\Api\Models\Order\OrderReferenceModel
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
ReplicaMyCartDraftModel
extends
JsonObjectModel
implements
ReplicaMyCartDraft
25
{
30
protected
$reference
;
31
32
36
public
function
__construct
(
37
?
JsonObject
$reference
=
null
38
) {
39
$this->reference =
$reference
;
40
}
41
48
public
function
getReference
()
49
{
50
if
(is_null($this->reference)) {
52
$data = $this->
raw
(self::FIELD_REFERENCE);
53
if
(is_null($data)) {
54
return
null
;
55
}
56
$this->reference = $data;
57
}
58
59
return
$this->reference
;
60
}
61
67
public
function
getReferenceAsCartReference
()
68
{
70
$data = $this->
raw
(self::FIELD_REFERENCE);
71
if
(is_null($data)) {
72
return
null
;
73
}
74
75
return
CartReferenceModel::of
($data);
76
}
77
83
public
function
getReferenceAsOrderReference
()
84
{
86
$data = $this->
raw
(self::FIELD_REFERENCE);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
91
return
OrderReferenceModel::of
($data);
92
}
93
97
public
function
setReference
(?
JsonObject
$reference
): void
98
{
99
$this->reference =
$reference
;
100
}
101
}
Commercetools\Api\Models\Cart\CartReferenceModel
Definition:
CartReferenceModel.php:23
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel
Definition:
ReplicaMyCartDraftModel.php:25
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel\getReference
getReference()
Definition:
ReplicaMyCartDraftModel.php:48
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel\__construct
__construct(?JsonObject $reference=null)
Definition:
ReplicaMyCartDraftModel.php:36
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel\$reference
$reference
Definition:
ReplicaMyCartDraftModel.php:30
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel\getReferenceAsOrderReference
getReferenceAsOrderReference()
Definition:
ReplicaMyCartDraftModel.php:83
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel\getReferenceAsCartReference
getReferenceAsCartReference()
Definition:
ReplicaMyCartDraftModel.php:67
Commercetools\Api\Models\Me\ReplicaMyCartDraftModel\setReference
setReference(?JsonObject $reference)
Definition:
ReplicaMyCartDraftModel.php:97
Commercetools\Api\Models\Order\OrderReferenceModel
Definition:
OrderReferenceModel.php:23
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\Api\Models\Cart\CartReference
Definition:
CartReference.php:16
Commercetools\Api\Models\Me\ReplicaMyCartDraft
Definition:
ReplicaMyCartDraft.php:17
Commercetools\Api\Models\Order\OrderReference
Definition:
OrderReference.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Me
Definition:
MyBusinessUnitAddAddressAction.php:9
Generated by
1.9.1