commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomerSignInResultBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class CustomerSignInResultBuilder implements Builder
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 
55  public function getCart()
56  {
57  return $this->cart instanceof CartBuilder ? $this->cart->build() : $this->cart;
58  }
59 
64  public function withCustomer(?Customer $customer)
65  {
66  $this->customer = $customer;
67 
68  return $this;
69  }
70 
75  public function withCart(?Cart $cart)
76  {
77  $this->cart = $cart;
78 
79  return $this;
80  }
81 
86  public function withCustomerBuilder(?CustomerBuilder $customer)
87  {
88  $this->customer = $customer;
89 
90  return $this;
91  }
92 
97  public function withCartBuilder(?CartBuilder $cart)
98  {
99  $this->cart = $cart;
100 
101  return $this;
102  }
103 
104  public function build(): CustomerSignInResult
105  {
106  return new CustomerSignInResultModel(
107  $this->customer instanceof CustomerBuilder ? $this->customer->build() : $this->customer,
108  $this->cart instanceof CartBuilder ? $this->cart->build() : $this->cart
109  );
110  }
111 
112  public static function of(): CustomerSignInResultBuilder
113  {
114  return new self();
115  }
116 }