commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Customfields
MoneyFieldBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Customfields
;
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
MoneyFieldBuilder
implements
Builder
24
{
29
private
$value;
30
35
public
function
getValue
()
36
{
37
return
$this->value instanceof
TypedMoneyBuilder
? $this->value->
build
() : $this->value;
38
}
39
44
public
function
withValue
(?
TypedMoney
$value)
45
{
46
$this->value = $value;
47
48
return
$this;
49
}
50
55
public
function
withValueBuilder
(?
TypedMoneyBuilder
$value)
56
{
57
$this->value = $value;
58
59
return
$this;
60
}
61
62
public
function
build
():
MoneyField
63
{
64
return
new
MoneyFieldModel
(
65
$this->value instanceof
TypedMoneyBuilder
? $this->value->
build
() : $this->value
66
);
67
}
68
69
public
static
function
of
():
MoneyFieldBuilder
70
{
71
return
new
self
();
72
}
73
}
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\Customfields\MoneyFieldBuilder
Definition:
MoneyFieldBuilder.php:24
Commercetools\Import\Models\Customfields\MoneyFieldBuilder\withValue
withValue(?TypedMoney $value)
Definition:
MoneyFieldBuilder.php:44
Commercetools\Import\Models\Customfields\MoneyFieldBuilder\of
static of()
Definition:
MoneyFieldBuilder.php:69
Commercetools\Import\Models\Customfields\MoneyFieldBuilder\getValue
getValue()
Definition:
MoneyFieldBuilder.php:35
Commercetools\Import\Models\Customfields\MoneyFieldBuilder\build
build()
Definition:
MoneyFieldBuilder.php:62
Commercetools\Import\Models\Customfields\MoneyFieldBuilder\withValueBuilder
withValueBuilder(?TypedMoneyBuilder $value)
Definition:
MoneyFieldBuilder.php:55
Commercetools\Import\Models\Customfields\MoneyFieldModel
Definition:
MoneyFieldModel.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\Customfields\MoneyField
Definition:
MoneyField.php:16
Commercetools\Import\Models\Customfields
Definition:
BooleanField.php:9
Generated by
1.9.1