commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
ProductSelection
ProductSelectionDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSelection
;
10
11
use
Commercetools\Api\Models\Common\LocalizedString
;
12
use
Commercetools\Api\Models\Common\LocalizedStringBuilder
;
13
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
14
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
15
use
Commercetools\Base\Builder
;
16
use
Commercetools\Base\DateTimeImmutableCollection
;
17
use
Commercetools\Base\JsonObject
;
18
use
Commercetools\Base\JsonObjectModel
;
19
use
Commercetools\Base\MapperFactory
;
20
use stdClass;
21
25
final
class
ProductSelectionDraftBuilder
implements
Builder
26
{
31
private
$key;
32
37
private
$name;
38
43
private
$custom;
44
49
private
$mode;
50
57
public
function
getKey
()
58
{
59
return
$this->key;
60
}
61
68
public
function
getName
()
69
{
70
return
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name;
71
}
72
79
public
function
getCustom
()
80
{
81
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
82
}
83
90
public
function
getMode
()
91
{
92
return
$this->mode;
93
}
94
99
public
function
withKey
(?
string
$key)
100
{
101
$this->key = $key;
102
103
return
$this;
104
}
105
110
public
function
withName
(?
LocalizedString
$name)
111
{
112
$this->name = $name;
113
114
return
$this;
115
}
116
121
public
function
withCustom
(?
CustomFieldsDraft
$custom)
122
{
123
$this->custom = $custom;
124
125
return
$this;
126
}
127
132
public
function
withMode
(?
string
$mode)
133
{
134
$this->mode = $mode;
135
136
return
$this;
137
}
138
143
public
function
withNameBuilder
(?
LocalizedStringBuilder
$name)
144
{
145
$this->name = $name;
146
147
return
$this;
148
}
149
154
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
155
{
156
$this->custom = $custom;
157
158
return
$this;
159
}
160
161
public
function
build
():
ProductSelectionDraft
162
{
163
return
new
ProductSelectionDraftModel
(
164
$this->key,
165
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name,
166
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom,
167
$this->mode
168
);
169
}
170
171
public
static
function
of
():
ProductSelectionDraftBuilder
172
{
173
return
new
self
();
174
}
175
}
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition:
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition:
LocalizedStringBuilder.php:42
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder
Definition:
ProductSelectionDraftBuilder.php:26
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\build
build()
Definition:
ProductSelectionDraftBuilder.php:161
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\withMode
withMode(?string $mode)
Definition:
ProductSelectionDraftBuilder.php:132
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\getName
getName()
Definition:
ProductSelectionDraftBuilder.php:68
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition:
ProductSelectionDraftBuilder.php:121
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\getCustom
getCustom()
Definition:
ProductSelectionDraftBuilder.php:79
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\of
static of()
Definition:
ProductSelectionDraftBuilder.php:171
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\withName
withName(?LocalizedString $name)
Definition:
ProductSelectionDraftBuilder.php:110
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\withNameBuilder
withNameBuilder(?LocalizedStringBuilder $name)
Definition:
ProductSelectionDraftBuilder.php:143
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition:
ProductSelectionDraftBuilder.php:154
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\getKey
getKey()
Definition:
ProductSelectionDraftBuilder.php:57
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\withKey
withKey(?string $key)
Definition:
ProductSelectionDraftBuilder.php:99
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftBuilder\getMode
getMode()
Definition:
ProductSelectionDraftBuilder.php:90
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel
Definition:
ProductSelectionDraftModel.php:25
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition:
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition:
CustomFieldsDraftBuilder.php:101
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\Api\Models\ProductSelection\ProductSelectionDraft
Definition:
ProductSelectionDraft.php:17
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition:
CustomFieldsDraft.php:15
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\ProductSelection
Definition:
AssignedProductReference.php:9
Generated by
1.9.1