commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Store
StoreSetCountriesActionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Store
;
10
11
use
Commercetools\Api\Models\StoreCountry\StoreCountryCollection
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
StoreSetCountriesActionModel
extends
JsonObjectModel
implements
StoreSetCountriesAction
22
{
23
public
const
DISCRIMINATOR_VALUE
=
'setCountries'
;
28
protected
$action
;
29
34
protected
$countries
;
35
36
40
public
function
__construct
(
41
?
StoreCountryCollection
$countries
=
null
,
42
?
string
$action
=
null
43
) {
44
$this->countries =
$countries
;
45
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
46
}
47
52
public
function
getAction
()
53
{
54
if
(is_null($this->action)) {
56
$data = $this->
raw
(self::FIELD_ACTION);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
$this->action = (string) $data;
61
}
62
63
return
$this->action
;
64
}
65
72
public
function
getCountries
()
73
{
74
if
(is_null($this->countries)) {
76
$data = $this->
raw
(self::FIELD_COUNTRIES);
77
if
(is_null($data)) {
78
return
null
;
79
}
80
$this->countries =
StoreCountryCollection::fromArray
($data);
81
}
82
83
return
$this->countries
;
84
}
85
86
90
public
function
setCountries
(?
StoreCountryCollection
$countries
): void
91
{
92
$this->countries =
$countries
;
93
}
94
}
Commercetools\Api\Models\Store\StoreSetCountriesActionModel
Definition:
StoreSetCountriesActionModel.php:22
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\getCountries
getCountries()
Definition:
StoreSetCountriesActionModel.php:72
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\__construct
__construct(?StoreCountryCollection $countries=null, ?string $action=null)
Definition:
StoreSetCountriesActionModel.php:40
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\getAction
getAction()
Definition:
StoreSetCountriesActionModel.php:52
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\$action
$action
Definition:
StoreSetCountriesActionModel.php:28
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\setCountries
setCountries(?StoreCountryCollection $countries)
Definition:
StoreSetCountriesActionModel.php:90
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\$countries
$countries
Definition:
StoreSetCountriesActionModel.php:34
Commercetools\Api\Models\Store\StoreSetCountriesActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
StoreSetCountriesActionModel.php:23
Commercetools\Api\Models\StoreCountry\StoreCountryCollection
Definition:
StoreCountryCollection.php:22
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Api\Models\Store\StoreSetCountriesAction
Definition:
StoreSetCountriesAction.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Store
Definition:
ProductSelectionSetting.php:9
Generated by
1.9.1