commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Customfields
ReferenceFieldBuilder.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\KeyReference
;
17
use
Commercetools\Import\Models\Common\KeyReferenceBuilder
;
18
use stdClass;
19
23
final
class
ReferenceFieldBuilder
implements
Builder
24
{
29
private
$value;
30
37
public
function
getValue
()
38
{
39
return
$this->value instanceof
KeyReferenceBuilder
? $this->value->
build
() : $this->value;
40
}
41
46
public
function
withValue
(?
KeyReference
$value)
47
{
48
$this->value = $value;
49
50
return
$this;
51
}
52
57
public
function
withValueBuilder
(?
KeyReferenceBuilder
$value)
58
{
59
$this->value = $value;
60
61
return
$this;
62
}
63
64
public
function
build
():
ReferenceField
65
{
66
return
new
ReferenceFieldModel
(
67
$this->value instanceof
KeyReferenceBuilder
? $this->value->
build
() : $this->value
68
);
69
}
70
71
public
static
function
of
():
ReferenceFieldBuilder
72
{
73
return
new
self
();
74
}
75
}
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\Customfields\ReferenceFieldBuilder
Definition:
ReferenceFieldBuilder.php:24
Commercetools\Import\Models\Customfields\ReferenceFieldBuilder\build
build()
Definition:
ReferenceFieldBuilder.php:64
Commercetools\Import\Models\Customfields\ReferenceFieldBuilder\getValue
getValue()
Definition:
ReferenceFieldBuilder.php:37
Commercetools\Import\Models\Customfields\ReferenceFieldBuilder\of
static of()
Definition:
ReferenceFieldBuilder.php:71
Commercetools\Import\Models\Customfields\ReferenceFieldBuilder\withValue
withValue(?KeyReference $value)
Definition:
ReferenceFieldBuilder.php:46
Commercetools\Import\Models\Customfields\ReferenceFieldBuilder\withValueBuilder
withValueBuilder(?KeyReferenceBuilder $value)
Definition:
ReferenceFieldBuilder.php:57
Commercetools\Import\Models\Customfields\ReferenceFieldModel
Definition:
ReferenceFieldModel.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\Customfields\ReferenceField
Definition:
ReferenceField.php:16
Commercetools\Import\Models\Customfields
Definition:
BooleanField.php:9
Generated by
1.9.1