commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StoreSetCountriesActionModel.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
23 public const DISCRIMINATOR_VALUE = 'setCountries';
28 protected $action;
29
34 protected $countries;
35
36
40 public function __construct(
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
91 {
92 $this->countries = $countries;
93 }
94}
__construct(?StoreCountryCollection $countries=null, ?string $action=null)