commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Productvariants
ReferenceAttributeBuilder.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\KeyReference
;
17
use
Commercetools\Import\Models\Common\KeyReferenceBuilder
;
18
use stdClass;
19
23
final
class
ReferenceAttributeBuilder
implements
Builder
24
{
29
private
$name;
30
35
private
$value;
36
45
public
function
getName
()
46
{
47
return
$this->name;
48
}
49
56
public
function
getValue
()
57
{
58
return
$this->value instanceof
KeyReferenceBuilder
? $this->value->
build
() : $this->value;
59
}
60
65
public
function
withName
(?
string
$name)
66
{
67
$this->name = $name;
68
69
return
$this;
70
}
71
76
public
function
withValue
(?
KeyReference
$value)
77
{
78
$this->value = $value;
79
80
return
$this;
81
}
82
87
public
function
withValueBuilder
(?
KeyReferenceBuilder
$value)
88
{
89
$this->value = $value;
90
91
return
$this;
92
}
93
94
public
function
build
():
ReferenceAttribute
95
{
96
return
new
ReferenceAttributeModel
(
97
$this->name,
98
$this->value instanceof
KeyReferenceBuilder
? $this->value->
build
() : $this->value
99
);
100
}
101
102
public
static
function
of
():
ReferenceAttributeBuilder
103
{
104
return
new
self
();
105
}
106
}
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\KeyReferenceBuilder
Definition:
KeyReferenceBuilder.php:22
Commercetools\Import\Models\Common\KeyReferenceBuilder\build
build()
Definition:
KeyReferenceBuilder.php:50
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder
Definition:
ReferenceAttributeBuilder.php:24
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\build
build()
Definition:
ReferenceAttributeBuilder.php:94
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\of
static of()
Definition:
ReferenceAttributeBuilder.php:102
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\getName
getName()
Definition:
ReferenceAttributeBuilder.php:45
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\getValue
getValue()
Definition:
ReferenceAttributeBuilder.php:56
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\withValueBuilder
withValueBuilder(?KeyReferenceBuilder $value)
Definition:
ReferenceAttributeBuilder.php:87
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\withValue
withValue(?KeyReference $value)
Definition:
ReferenceAttributeBuilder.php:76
Commercetools\Import\Models\Productvariants\ReferenceAttributeBuilder\withName
withName(?string $name)
Definition:
ReferenceAttributeBuilder.php:65
Commercetools\Import\Models\Productvariants\ReferenceAttributeModel
Definition:
ReferenceAttributeModel.php:23
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\KeyReference
Definition:
KeyReference.php:15
Commercetools\Import\Models\Productvariants\ReferenceAttribute
Definition:
ReferenceAttribute.php:16
Commercetools\Import\Models\Productvariants
Definition:
Attribute.php:9
Generated by
1.9.1