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
76 public function getCart()
77 {
78 if (is_null($this->cart)) {
80 $data = $this->raw(self::FIELD_CART);
81 if (is_null($data)) {
82 return null;
83 }
84
85 $this->cart = CartModel::of($data);
86 }
87
88 return $this->cart;
89 }
90
91
95 public function setCustomer(?Customer $customer): void
96 {
97 $this->customer = $customer;
98 }
99
103 public function setCart(?Cart $cart): void
104 {
105 $this->cart = $cart;
106 }
107}