commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantSetAssetsActionModel.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
23 public const DISCRIMINATOR_VALUE = 'setAssets';
28 protected $action;
29
34 protected $assets;
35
40 protected $staged;
41
42
46 public function __construct(
48 ?bool $staged = null,
49 ?string $action = null
50 ) {
51 $this->assets = $assets;
52 $this->staged = $staged;
53 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
54 }
55
60 public function getAction()
61 {
62 if (is_null($this->action)) {
64 $data = $this->raw(self::FIELD_ACTION);
65 if (is_null($data)) {
66 return null;
67 }
68 $this->action = (string) $data;
69 }
70
71 return $this->action;
72 }
73
80 public function getAssets()
81 {
82 if (is_null($this->assets)) {
84 $data = $this->raw(self::FIELD_ASSETS);
85 if (is_null($data)) {
86 return null;
87 }
88 $this->assets = AssetDraftCollection::fromArray($data);
89 }
90
91 return $this->assets;
92 }
93
100 public function getStaged()
101 {
102 if (is_null($this->staged)) {
104 $data = $this->raw(self::FIELD_STAGED);
105 if (is_null($data)) {
106 return null;
107 }
108 $this->staged = (bool) $data;
109 }
110
111 return $this->staged;
112 }
113
114
118 public function setAssets(?AssetDraftCollection $assets): void
119 {
120 $this->assets = $assets;
121 }
122
126 public function setStaged(?bool $staged): void
127 {
128 $this->staged = $staged;
129 }
130}
__construct(?AssetDraftCollection $assets=null, ?bool $staged=null, ?string $action=null)