commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
CartDiscount
CartDiscountChangeTargetActionBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CartDiscount
;
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 stdClass;
17
21
final
class
CartDiscountChangeTargetActionBuilder
implements
Builder
22
{
27
private
$target;
28
35
public
function
getTarget
()
36
{
37
return
$this->target instanceof
CartDiscountTargetBuilder
? $this->target->
build
() : $this->target;
38
}
39
44
public
function
withTarget
(?
CartDiscountTarget
$target)
45
{
46
$this->target = $target;
47
48
return
$this;
49
}
50
55
public
function
withTargetBuilder
(?
CartDiscountTargetBuilder
$target)
56
{
57
$this->target = $target;
58
59
return
$this;
60
}
61
62
public
function
build
():
CartDiscountChangeTargetAction
63
{
64
return
new
CartDiscountChangeTargetActionModel
(
65
$this->target instanceof
CartDiscountTargetBuilder
? $this->target->
build
() : $this->target
66
);
67
}
68
69
public
static
function
of
():
CartDiscountChangeTargetActionBuilder
70
{
71
return
new
self
();
72
}
73
}
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionBuilder
Definition:
CartDiscountChangeTargetActionBuilder.php:22
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionBuilder\withTargetBuilder
withTargetBuilder(?CartDiscountTargetBuilder $target)
Definition:
CartDiscountChangeTargetActionBuilder.php:55
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionBuilder\of
static of()
Definition:
CartDiscountChangeTargetActionBuilder.php:69
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionBuilder\getTarget
getTarget()
Definition:
CartDiscountChangeTargetActionBuilder.php:35
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionBuilder\withTarget
withTarget(?CartDiscountTarget $target)
Definition:
CartDiscountChangeTargetActionBuilder.php:44
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionBuilder\build
build()
Definition:
CartDiscountChangeTargetActionBuilder.php:62
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetActionModel
Definition:
CartDiscountChangeTargetActionModel.php:21
Commercetools\Api\Models\CartDiscount\CartDiscountTargetBuilder
Definition:
CartDiscountTargetBuilder.php:22
Commercetools\Api\Models\CartDiscount\CartDiscountTargetBuilder\build
build()
Definition:
CartDiscountTargetBuilder.php:23
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\CartDiscount\CartDiscountChangeTargetAction
Definition:
CartDiscountChangeTargetAction.php:15
Commercetools\Api\Models\CartDiscount\CartDiscountTarget
Definition:
CartDiscountTarget.php:15
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\CartDiscount
Definition:
CartDiscount.php:9
Generated by
1.9.1