commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomerSignInResultBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $customer;
30
35 private $cart;
36
43 public function getCustomer()
44 {
45 return $this->customer instanceof CustomerBuilder ? $this->customer->build() : $this->customer;
46 }
47
57 public function getCart()
58 {
59 return $this->cart instanceof CartBuilder ? $this->cart->build() : $this->cart;
60 }
61
66 public function withCustomer(?Customer $customer)
67 {
68 $this->customer = $customer;
69
70 return $this;
71 }
72
77 public function withCart(?Cart $cart)
78 {
79 $this->cart = $cart;
80
81 return $this;
82 }
83
88 public function withCustomerBuilder(?CustomerBuilder $customer)
89 {
90 $this->customer = $customer;
91
92 return $this;
93 }
94
99 public function withCartBuilder(?CartBuilder $cart)
100 {
101 $this->cart = $cart;
102
103 return $this;
104 }
105
106 public function build(): CustomerSignInResult
107 {
108 return new CustomerSignInResultModel(
109 $this->customer instanceof CustomerBuilder ? $this->customer->build() : $this->customer,
110 $this->cart instanceof CartBuilder ? $this->cart->build() : $this->cart
111 );
112 }
113
114 public static function of(): CustomerSignInResultBuilder
115 {
116 return new self();
117 }
118}