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
ProductSearchRequestBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSearch
;
10
11
use
Commercetools\Api\Models\Search\SearchQuery
;
12
use
Commercetools\Api\Models\Search\SearchQueryBuilder
;
13
use
Commercetools\Api\Models\Search\SearchSortingCollection
;
14
use
Commercetools\Base\Builder
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
ProductSearchRequestBuilder
implements
Builder
25
{
30
private
$query;
31
36
private
$sort;
37
42
private
$limit;
43
48
private
$offset;
49
54
private
$markMatchingVariants;
55
60
private
$productProjectionParameters;
61
66
private
$facets;
67
72
private
$postFilter;
73
80
public
function
getQuery
()
81
{
82
return
$this->query instanceof
SearchQueryBuilder
? $this->query->
build
() : $this->query;
83
}
84
92
public
function
getSort
()
93
{
94
return
$this->sort;
95
}
96
103
public
function
getLimit
()
104
{
105
return
$this->limit;
106
}
107
114
public
function
getOffset
()
115
{
116
return
$this->offset;
117
}
118
125
public
function
getMarkMatchingVariants
()
126
{
127
return
$this->markMatchingVariants;
128
}
129
137
public
function
getProductProjectionParameters
()
138
{
139
return
$this->productProjectionParameters instanceof
ProductSearchProjectionParamsBuilder
? $this->productProjectionParameters->
build
() : $this->productProjectionParameters;
140
}
141
148
public
function
getFacets
()
149
{
150
return
$this->facets;
151
}
152
160
public
function
getPostFilter
()
161
{
162
return
$this->postFilter instanceof
SearchQueryBuilder
? $this->postFilter->
build
() : $this->postFilter;
163
}
164
169
public
function
withQuery
(?
SearchQuery
$query)
170
{
171
$this->query = $query;
172
173
return
$this;
174
}
175
180
public
function
withSort
(?
SearchSortingCollection
$sort)
181
{
182
$this->sort = $sort;
183
184
return
$this;
185
}
186
191
public
function
withLimit
(?
int
$limit)
192
{
193
$this->limit = $limit;
194
195
return
$this;
196
}
197
202
public
function
withOffset
(?
int
$offset)
203
{
204
$this->offset = $offset;
205
206
return
$this;
207
}
208
213
public
function
withMarkMatchingVariants
(?
bool
$markMatchingVariants)
214
{
215
$this->markMatchingVariants = $markMatchingVariants;
216
217
return
$this;
218
}
219
224
public
function
withProductProjectionParameters
(?
ProductSearchProjectionParams
$productProjectionParameters)
225
{
226
$this->productProjectionParameters = $productProjectionParameters;
227
228
return
$this;
229
}
230
235
public
function
withFacets
(?
ProductSearchFacetExpressionCollection
$facets)
236
{
237
$this->facets = $facets;
238
239
return
$this;
240
}
241
246
public
function
withPostFilter
(?
SearchQuery
$postFilter)
247
{
248
$this->postFilter = $postFilter;
249
250
return
$this;
251
}
252
257
public
function
withQueryBuilder
(?
SearchQueryBuilder
$query)
258
{
259
$this->query = $query;
260
261
return
$this;
262
}
263
268
public
function
withProductProjectionParametersBuilder
(?
ProductSearchProjectionParamsBuilder
$productProjectionParameters)
269
{
270
$this->productProjectionParameters = $productProjectionParameters;
271
272
return
$this;
273
}
274
279
public
function
withPostFilterBuilder
(?
SearchQueryBuilder
$postFilter)
280
{
281
$this->postFilter = $postFilter;
282
283
return
$this;
284
}
285
286
public
function
build
():
ProductSearchRequest
287
{
288
return
new
ProductSearchRequestModel
(
289
$this->query instanceof
SearchQueryBuilder
? $this->query->
build
() : $this->query,
290
$this->sort,
291
$this->limit,
292
$this->offset,
293
$this->markMatchingVariants,
294
$this->productProjectionParameters instanceof
ProductSearchProjectionParamsBuilder
? $this->productProjectionParameters->
build
() : $this->productProjectionParameters,
295
$this->facets,
296
$this->postFilter instanceof
SearchQueryBuilder
? $this->postFilter->
build
() : $this->postFilter
297
);
298
}
299
300
public
static
function
of
():
ProductSearchRequestBuilder
301
{
302
return
new
self
();
303
}
304
}
Commercetools\Api\Models\ProductSearch\ProductSearchFacetExpressionCollection
Definition
ProductSearchFacetExpressionCollection.php:26
Commercetools\Api\Models\ProductSearch\ProductSearchProjectionParamsBuilder
Definition
ProductSearchProjectionParamsBuilder.php:22
Commercetools\Api\Models\ProductSearch\ProductSearchProjectionParamsBuilder\build
build()
Definition
ProductSearchProjectionParamsBuilder.php:253
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder
Definition
ProductSearchRequestBuilder.php:25
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getOffset
getOffset()
Definition
ProductSearchRequestBuilder.php:114
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getFacets
getFacets()
Definition
ProductSearchRequestBuilder.php:148
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withLimit
withLimit(?int $limit)
Definition
ProductSearchRequestBuilder.php:191
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getMarkMatchingVariants
getMarkMatchingVariants()
Definition
ProductSearchRequestBuilder.php:125
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\build
build()
Definition
ProductSearchRequestBuilder.php:286
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\of
static of()
Definition
ProductSearchRequestBuilder.php:300
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withFacets
withFacets(?ProductSearchFacetExpressionCollection $facets)
Definition
ProductSearchRequestBuilder.php:235
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getProductProjectionParameters
getProductProjectionParameters()
Definition
ProductSearchRequestBuilder.php:137
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getQuery
getQuery()
Definition
ProductSearchRequestBuilder.php:80
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withOffset
withOffset(?int $offset)
Definition
ProductSearchRequestBuilder.php:202
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withMarkMatchingVariants
withMarkMatchingVariants(?bool $markMatchingVariants)
Definition
ProductSearchRequestBuilder.php:213
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withPostFilterBuilder
withPostFilterBuilder(?SearchQueryBuilder $postFilter)
Definition
ProductSearchRequestBuilder.php:279
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getPostFilter
getPostFilter()
Definition
ProductSearchRequestBuilder.php:160
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withPostFilter
withPostFilter(?SearchQuery $postFilter)
Definition
ProductSearchRequestBuilder.php:246
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getLimit
getLimit()
Definition
ProductSearchRequestBuilder.php:103
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withSort
withSort(?SearchSortingCollection $sort)
Definition
ProductSearchRequestBuilder.php:180
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withProductProjectionParametersBuilder
withProductProjectionParametersBuilder(?ProductSearchProjectionParamsBuilder $productProjectionParameters)
Definition
ProductSearchRequestBuilder.php:268
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\getSort
getSort()
Definition
ProductSearchRequestBuilder.php:92
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withQuery
withQuery(?SearchQuery $query)
Definition
ProductSearchRequestBuilder.php:169
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withQueryBuilder
withQueryBuilder(?SearchQueryBuilder $query)
Definition
ProductSearchRequestBuilder.php:257
Commercetools\Api\Models\ProductSearch\ProductSearchRequestBuilder\withProductProjectionParameters
withProductProjectionParameters(?ProductSearchProjectionParams $productProjectionParameters)
Definition
ProductSearchRequestBuilder.php:224
Commercetools\Api\Models\ProductSearch\ProductSearchRequestModel
Definition
ProductSearchRequestModel.php:24
Commercetools\Api\Models\Search\SearchQueryBuilder
Definition
SearchQueryBuilder.php:22
Commercetools\Api\Models\Search\SearchQueryBuilder\build
build()
Definition
SearchQueryBuilder.php:23
Commercetools\Api\Models\Search\SearchSortingCollection
Definition
SearchSortingCollection.php:22
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\ProductSearch\ProductSearchProjectionParams
Definition
ProductSearchProjectionParams.php:15
Commercetools\Api\Models\ProductSearch\ProductSearchRequest
Definition
ProductSearchRequest.php:17
Commercetools\Api\Models\Search\SearchQuery
Definition
SearchQuery.php:15
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