commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Common
DiscountedPriceDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Common
;
10
11
use
Commercetools\Api\Models\ProductDiscount\ProductDiscountReference
;
12
use
Commercetools\Api\Models\ProductDiscount\ProductDiscountReferenceBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
DiscountedPriceDraftBuilder
implements
Builder
24
{
29
private
$value;
30
35
private
$discount;
36
44
public
function
getValue
()
45
{
46
return
$this->value instanceof
MoneyBuilder
? $this->value->
build
() : $this->value;
47
}
48
55
public
function
getDiscount
()
56
{
57
return
$this->discount instanceof
ProductDiscountReferenceBuilder
? $this->discount->
build
() : $this->discount;
58
}
59
64
public
function
withValue
(?
Money
$value)
65
{
66
$this->value = $value;
67
68
return
$this;
69
}
70
75
public
function
withDiscount
(?
ProductDiscountReference
$discount)
76
{
77
$this->discount = $discount;
78
79
return
$this;
80
}
81
86
public
function
withValueBuilder
(?
MoneyBuilder
$value)
87
{
88
$this->value = $value;
89
90
return
$this;
91
}
92
97
public
function
withDiscountBuilder
(?
ProductDiscountReferenceBuilder
$discount)
98
{
99
$this->discount = $discount;
100
101
return
$this;
102
}
103
104
public
function
build
():
DiscountedPriceDraft
105
{
106
return
new
DiscountedPriceDraftModel
(
107
$this->value instanceof
MoneyBuilder
? $this->value->
build
() : $this->value,
108
$this->discount instanceof
ProductDiscountReferenceBuilder
? $this->discount->
build
() : $this->discount
109
);
110
}
111
112
public
static
function
of
():
DiscountedPriceDraftBuilder
113
{
114
return
new
self
();
115
}
116
}
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder
Definition
DiscountedPriceDraftBuilder.php:24
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\withDiscountBuilder
withDiscountBuilder(?ProductDiscountReferenceBuilder $discount)
Definition
DiscountedPriceDraftBuilder.php:97
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\withDiscount
withDiscount(?ProductDiscountReference $discount)
Definition
DiscountedPriceDraftBuilder.php:75
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\withValue
withValue(?Money $value)
Definition
DiscountedPriceDraftBuilder.php:64
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\withValueBuilder
withValueBuilder(?MoneyBuilder $value)
Definition
DiscountedPriceDraftBuilder.php:86
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\getValue
getValue()
Definition
DiscountedPriceDraftBuilder.php:44
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\of
static of()
Definition
DiscountedPriceDraftBuilder.php:112
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\build
build()
Definition
DiscountedPriceDraftBuilder.php:104
Commercetools\Api\Models\Common\DiscountedPriceDraftBuilder\getDiscount
getDiscount()
Definition
DiscountedPriceDraftBuilder.php:55
Commercetools\Api\Models\Common\DiscountedPriceDraftModel
Definition
DiscountedPriceDraftModel.php:23
Commercetools\Api\Models\Common\MoneyBuilder
Definition
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition
MoneyBuilder.php:84
Commercetools\Api\Models\ProductDiscount\ProductDiscountReferenceBuilder
Definition
ProductDiscountReferenceBuilder.php:24
Commercetools\Api\Models\ProductDiscount\ProductDiscountReferenceBuilder\build
build()
Definition
ProductDiscountReferenceBuilder.php:92
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\DiscountedPriceDraft
Definition
DiscountedPriceDraft.php:16
Commercetools\Api\Models\Common\Money
Definition
Money.php:15
Commercetools\Api\Models\ProductDiscount\ProductDiscountReference
Definition
ProductDiscountReference.php:16
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Common
Definition
Address.php:9
Generated by
1.9.8