commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantAddExternalImageActionModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'addExternalImage';
29 protected $action;
30
35 protected $image;
36
41 protected $staged;
42
43
47 public function __construct(
48 ?Image $image = null,
49 ?bool $staged = null,
50 ?string $action = null
51 ) {
52 $this->image = $image;
53 $this->staged = $staged;
54 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
55 }
56
61 public function getAction()
62 {
63 if (is_null($this->action)) {
65 $data = $this->raw(self::FIELD_ACTION);
66 if (is_null($data)) {
67 return null;
68 }
69 $this->action = (string) $data;
70 }
71
72 return $this->action;
73 }
74
81 public function getImage()
82 {
83 if (is_null($this->image)) {
85 $data = $this->raw(self::FIELD_IMAGE);
86 if (is_null($data)) {
87 return null;
88 }
89
90 $this->image = ImageModel::of($data);
91 }
92
93 return $this->image;
94 }
95
102 public function getStaged()
103 {
104 if (is_null($this->staged)) {
106 $data = $this->raw(self::FIELD_STAGED);
107 if (is_null($data)) {
108 return null;
109 }
110 $this->staged = (bool) $data;
111 }
112
113 return $this->staged;
114 }
115
116
120 public function setImage(?Image $image): void
121 {
122 $this->image = $image;
123 }
124
128 public function setStaged(?bool $staged): void
129 {
130 $this->staged = $staged;
131 }
132}
__construct(?Image $image=null, ?bool $staged=null, ?string $action=null)