commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Customer
CustomerSignInResultModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Customer
;
10
11
use
Commercetools\Api\Models\Cart\Cart
;
12
use
Commercetools\Api\Models\Cart\CartModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
CustomerSignInResultModel
extends
JsonObjectModel
implements
CustomerSignInResult
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
}
Commercetools\Api\Models\Cart\CartModel
Definition:
CartModel.php:44
Commercetools\Api\Models\Customer\CustomerSignInResultModel
Definition:
CustomerSignInResultModel.php:23
Commercetools\Api\Models\Customer\CustomerSignInResultModel\setCustomer
setCustomer(?Customer $customer)
Definition:
CustomerSignInResultModel.php:95
Commercetools\Api\Models\Customer\CustomerSignInResultModel\__construct
__construct(?Customer $customer=null, ?Cart $cart=null)
Definition:
CustomerSignInResultModel.php:40
Commercetools\Api\Models\Customer\CustomerSignInResultModel\$cart
$cart
Definition:
CustomerSignInResultModel.php:34
Commercetools\Api\Models\Customer\CustomerSignInResultModel\getCustomer
getCustomer()
Definition:
CustomerSignInResultModel.php:54
Commercetools\Api\Models\Customer\CustomerSignInResultModel\getCart
getCart()
Definition:
CustomerSignInResultModel.php:76
Commercetools\Api\Models\Customer\CustomerSignInResultModel\setCart
setCart(?Cart $cart)
Definition:
CustomerSignInResultModel.php:103
Commercetools\Api\Models\Customer\CustomerSignInResultModel\$customer
$customer
Definition:
CustomerSignInResultModel.php:28
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\Cart
Definition:
Cart.php:28
Commercetools\Api\Models\Customer\Customer
Definition:
Customer.php:23
Commercetools\Api\Models\Customer\CustomerSignInResult
Definition:
CustomerSignInResult.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Customer
Definition:
Customer.php:9
Generated by
1.9.1