commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Productvariants
MoneyAttributeBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Productvariants
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use
Commercetools\Import\Models\Common\TypedMoney
;
17
use
Commercetools\Import\Models\Common\TypedMoneyBuilder
;
18
use stdClass;
19
23
final
class
MoneyAttributeBuilder
implements
Builder
24
{
29
private
$name;
30
35
private
$value;
36
45
public
function
getName
()
46
{
47
return
$this->name;
48
}
49
54
public
function
getValue
()
55
{
56
return
$this->value instanceof
TypedMoneyBuilder
? $this->value->
build
() : $this->value;
57
}
58
63
public
function
withName
(?
string
$name)
64
{
65
$this->name = $name;
66
67
return
$this;
68
}
69
74
public
function
withValue
(?
TypedMoney
$value)
75
{
76
$this->value = $value;
77
78
return
$this;
79
}
80
85
public
function
withValueBuilder
(?
TypedMoneyBuilder
$value)
86
{
87
$this->value = $value;
88
89
return
$this;
90
}
91
92
public
function
build
():
MoneyAttribute
93
{
94
return
new
MoneyAttributeModel
(
95
$this->name,
96
$this->value instanceof
TypedMoneyBuilder
? $this->value->
build
() : $this->value
97
);
98
}
99
100
public
static
function
of
():
MoneyAttributeBuilder
101
{
102
return
new
self
();
103
}
104
}
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Import\Models\Common\TypedMoneyBuilder
Definition:
TypedMoneyBuilder.php:22
Commercetools\Import\Models\Common\TypedMoneyBuilder\build
build()
Definition:
TypedMoneyBuilder.php:104
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder
Definition:
MoneyAttributeBuilder.php:24
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\of
static of()
Definition:
MoneyAttributeBuilder.php:100
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\withValue
withValue(?TypedMoney $value)
Definition:
MoneyAttributeBuilder.php:74
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\getName
getName()
Definition:
MoneyAttributeBuilder.php:45
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\build
build()
Definition:
MoneyAttributeBuilder.php:92
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\withValueBuilder
withValueBuilder(?TypedMoneyBuilder $value)
Definition:
MoneyAttributeBuilder.php:85
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\getValue
getValue()
Definition:
MoneyAttributeBuilder.php:54
Commercetools\Import\Models\Productvariants\MoneyAttributeBuilder\withName
withName(?string $name)
Definition:
MoneyAttributeBuilder.php:63
Commercetools\Import\Models\Productvariants\MoneyAttributeModel
Definition:
MoneyAttributeModel.php:23
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\TypedMoney
Definition:
TypedMoney.php:15
Commercetools\Import\Models\Productvariants\MoneyAttribute
Definition:
MoneyAttribute.php:16
Commercetools\Import\Models\Productvariants
Definition:
Attribute.php:9
Generated by
1.9.1