commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomerSetStoresActionModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
23  public const DISCRIMINATOR_VALUE = 'setStores';
28  protected $action;
29 
34  protected $stores;
35 
36 
40  public function __construct(
42  ?string $action = null
43  ) {
44  $this->stores = $stores;
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 getStores()
73  {
74  if (is_null($this->stores)) {
76  $data = $this->raw(self::FIELD_STORES);
77  if (is_null($data)) {
78  return null;
79  }
80  $this->stores = StoreResourceIdentifierCollection::fromArray($data);
81  }
82 
83  return $this->stores;
84  }
85 
86 
91  {
92  $this->stores = $stores;
93  }
94 }
__construct(?StoreResourceIdentifierCollection $stores=null, ?string $action=null)