commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ImportSummaryBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class ImportSummaryBuilder implements Builder
22{
27 private $states;
28
33 private $total;
34
41 public function getStates()
42 {
43 return $this->states instanceof OperationStatesBuilder ? $this->states->build() : $this->states;
44 }
45
52 public function getTotal()
53 {
54 return $this->total;
55 }
56
61 public function withStates(?OperationStates $states)
62 {
63 $this->states = $states;
64
65 return $this;
66 }
67
72 public function withTotal(?int $total)
73 {
74 $this->total = $total;
75
76 return $this;
77 }
78
83 public function withStatesBuilder(?OperationStatesBuilder $states)
84 {
85 $this->states = $states;
86
87 return $this;
88 }
89
90 public function build(): ImportSummary
91 {
92 return new ImportSummaryModel(
93 $this->states instanceof OperationStatesBuilder ? $this->states->build() : $this->states,
94 $this->total
95 );
96 }
97
98 public static function of(): ImportSummaryBuilder
99 {
100 return new self();
101 }
102}