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
ProductSearch
ProductSearchResultBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSearch
;
10
11
use
Commercetools\Api\Models\Product\ProductProjection
;
12
use
Commercetools\Api\Models\Product\ProductProjectionBuilder
;
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
ProductSearchResultBuilder
implements
Builder
24
{
29
private
$id;
30
35
private
$productProjection;
36
41
private
$matchingVariants;
42
49
public
function
getId
()
50
{
51
return
$this->id;
52
}
53
60
public
function
getProductProjection
()
61
{
62
return
$this->productProjection instanceof
ProductProjectionBuilder
? $this->productProjection->
build
() : $this->productProjection;
63
}
64
71
public
function
getMatchingVariants
()
72
{
73
return
$this->matchingVariants instanceof
ProductSearchMatchingVariantsBuilder
? $this->matchingVariants->
build
() : $this->matchingVariants;
74
}
75
80
public
function
withId
(?
string
$id)
81
{
82
$this->
id
= $id;
83
84
return
$this;
85
}
86
91
public
function
withProductProjection
(?
ProductProjection
$productProjection)
92
{
93
$this->productProjection = $productProjection;
94
95
return
$this;
96
}
97
102
public
function
withMatchingVariants
(?
ProductSearchMatchingVariants
$matchingVariants)
103
{
104
$this->matchingVariants = $matchingVariants;
105
106
return
$this;
107
}
108
113
public
function
withProductProjectionBuilder
(?
ProductProjectionBuilder
$productProjection)
114
{
115
$this->productProjection = $productProjection;
116
117
return
$this;
118
}
119
124
public
function
withMatchingVariantsBuilder
(?
ProductSearchMatchingVariantsBuilder
$matchingVariants)
125
{
126
$this->matchingVariants = $matchingVariants;
127
128
return
$this;
129
}
130
131
public
function
build
():
ProductSearchResult
132
{
133
return
new
ProductSearchResultModel
(
134
$this->
id
,
135
$this->productProjection instanceof
ProductProjectionBuilder
? $this->productProjection->
build
() : $this->productProjection,
136
$this->matchingVariants instanceof
ProductSearchMatchingVariantsBuilder
? $this->matchingVariants->
build
() : $this->matchingVariants
137
);
138
}
139
140
public
static
function
of
():
ProductSearchResultBuilder
141
{
142
return
new
self
();
143
}
144
}
Commercetools\Api\Models\Product\ProductProjectionBuilder
Definition
ProductProjectionBuilder.php:36
Commercetools\Api\Models\Product\ProductProjectionBuilder\build
build()
Definition
ProductProjectionBuilder.php:827
Commercetools\Api\Models\ProductSearch\ProductSearchMatchingVariantsBuilder
Definition
ProductSearchMatchingVariantsBuilder.php:22
Commercetools\Api\Models\ProductSearch\ProductSearchMatchingVariantsBuilder\build
build()
Definition
ProductSearchMatchingVariantsBuilder.php:80
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder
Definition
ProductSearchResultBuilder.php:24
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\build
build()
Definition
ProductSearchResultBuilder.php:131
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\withMatchingVariantsBuilder
withMatchingVariantsBuilder(?ProductSearchMatchingVariantsBuilder $matchingVariants)
Definition
ProductSearchResultBuilder.php:124
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\getProductProjection
getProductProjection()
Definition
ProductSearchResultBuilder.php:60
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\of
static of()
Definition
ProductSearchResultBuilder.php:140
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\withProductProjection
withProductProjection(?ProductProjection $productProjection)
Definition
ProductSearchResultBuilder.php:91
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\withProductProjectionBuilder
withProductProjectionBuilder(?ProductProjectionBuilder $productProjection)
Definition
ProductSearchResultBuilder.php:113
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\getId
getId()
Definition
ProductSearchResultBuilder.php:49
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\getMatchingVariants
getMatchingVariants()
Definition
ProductSearchResultBuilder.php:71
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\withId
withId(?string $id)
Definition
ProductSearchResultBuilder.php:80
Commercetools\Api\Models\ProductSearch\ProductSearchResultBuilder\withMatchingVariants
withMatchingVariants(?ProductSearchMatchingVariants $matchingVariants)
Definition
ProductSearchResultBuilder.php:102
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel
Definition
ProductSearchResultModel.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\Product\ProductProjection
Definition
ProductProjection.php:23
Commercetools\Api\Models\ProductSearch\ProductSearchMatchingVariants
Definition
ProductSearchMatchingVariants.php:15
Commercetools\Api\Models\ProductSearch\ProductSearchResult
Definition
ProductSearchResult.php:16
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\ProductSearch
Definition
ProductPagedSearchResponse.php:9
Generated by
1.9.8