commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Importsummaries
ImportSummaryModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Importsummaries
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
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
}
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\Import\Models\Importsummaries\ImportSummaryModel
Definition:
ImportSummaryModel.php:21
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\$total
$total
Definition:
ImportSummaryModel.php:32
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\getStates
getStates()
Definition:
ImportSummaryModel.php:52
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\$states
$states
Definition:
ImportSummaryModel.php:26
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\__construct
__construct(?OperationStates $states=null, ?int $total=null)
Definition:
ImportSummaryModel.php:38
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\setTotal
setTotal(?int $total)
Definition:
ImportSummaryModel.php:99
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\setStates
setStates(?OperationStates $states)
Definition:
ImportSummaryModel.php:91
Commercetools\Import\Models\Importsummaries\ImportSummaryModel\getTotal
getTotal()
Definition:
ImportSummaryModel.php:73
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Importsummaries\ImportSummary
Definition:
ImportSummary.php:15
Commercetools\Import\Models\Importsummaries\OperationStates
Definition:
OperationStates.php:15
Commercetools\Import\Models\Importsummaries
Definition:
ImportSummary.php:9
Generated by
1.9.1