commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ReplicaMyCartDraftModel.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
25{
30 protected $reference;
31
32
36 public function __construct(
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
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
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}