commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomerSignInResultModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $customer;
29
34 protected $cart;
35
36
40 public function __construct(
41 ?Customer $customer = null,
42 ?Cart $cart = null
43 ) {
44 $this->customer = $customer;
45 $this->cart = $cart;
46 }
47
54 public function getCustomer()
55 {
56 if (is_null($this->customer)) {
58 $data = $this->raw(self::FIELD_CUSTOMER);
59 if (is_null($data)) {
60 return null;
61 }
62
63 $this->customer = CustomerModel::of($data);
64 }
65
66 return $this->customer;
67 }
68
78 public function getCart()
79 {
80 if (is_null($this->cart)) {
82 $data = $this->raw(self::FIELD_CART);
83 if (is_null($data)) {
84 return null;
85 }
86
87 $this->cart = CartModel::of($data);
88 }
89
90 return $this->cart;
91 }
92
93
97 public function setCustomer(?Customer $customer): void
98 {
99 $this->customer = $customer;
100 }
101
105 public function setCart(?Cart $cart): void
106 {
107 $this->cart = $cart;
108 }
109}