commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantAddAssetActionBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $staged;
30
35 private $asset;
36
41 private $position;
42
49 public function getStaged()
50 {
51 return $this->staged;
52 }
53
60 public function getAsset()
61 {
62 return $this->asset instanceof AssetDraftBuilder ? $this->asset->build() : $this->asset;
63 }
64
71 public function getPosition()
72 {
73 return $this->position;
74 }
75
80 public function withStaged(?bool $staged)
81 {
82 $this->staged = $staged;
83
84 return $this;
85 }
86
91 public function withAsset(?AssetDraft $asset)
92 {
93 $this->asset = $asset;
94
95 return $this;
96 }
97
102 public function withPosition(?int $position)
103 {
104 $this->position = $position;
105
106 return $this;
107 }
108
113 public function withAssetBuilder(?AssetDraftBuilder $asset)
114 {
115 $this->asset = $asset;
116
117 return $this;
118 }
119
120 public function build(): VariantAddAssetAction
121 {
123 $this->staged,
124 $this->asset instanceof AssetDraftBuilder ? $this->asset->build() : $this->asset,
125 $this->position
126 );
127 }
128
129 public static function of(): VariantAddAssetActionBuilder
130 {
131 return new self();
132 }
133}