commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ImportSummaryModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class ImportSummaryModel extends JsonObjectModel implements ImportSummary
21 {
26  protected $states;
27 
32  protected $total;
33 
34 
38  public function __construct(
39  ?OperationStates $states = null,
40  ?int $total = null
41  ) {
42  $this->states = $states;
43  $this->total = $total;
44  }
45 
52  public function getStates()
53  {
54  if (is_null($this->states)) {
56  $data = $this->raw(self::FIELD_STATES);
57  if (is_null($data)) {
58  return null;
59  }
60 
61  $this->states = OperationStatesModel::of($data);
62  }
63 
64  return $this->states;
65  }
66 
73  public function getTotal()
74  {
75  if (is_null($this->total)) {
77  $data = $this->raw(self::FIELD_TOTAL);
78  if (is_null($data)) {
79  return null;
80  }
81  $this->total = (int) $data;
82  }
83 
84  return $this->total;
85  }
86 
87 
91  public function setStates(?OperationStates $states): void
92  {
93  $this->states = $states;
94  }
95 
99  public function setTotal(?int $total): void
100  {
101  $this->total = $total;
102  }
103 }
__construct(?OperationStates $states=null, ?int $total=null)