commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
CustomerSearch
CustomerSearchRequestModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CustomerSearch
;
10
11
use
Commercetools\Api\Models\Search\SearchQuery
;
12
use
Commercetools\Api\Models\Search\SearchQueryModel
;
13
use
Commercetools\Api\Models\Search\SearchSortingCollection
;
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
CustomerSearchRequestModel
extends
JsonObjectModel
implements
CustomerSearchRequest
24
{
29
protected
$query
;
30
35
protected
$sort
;
36
41
protected
$limit
;
42
47
protected
$offset
;
48
49
53
public
function
__construct
(
54
?
SearchQuery
$query
=
null
,
55
?
SearchSortingCollection
$sort
=
null
,
56
?
int
$limit
=
null
,
57
?
int
$offset
=
null
58
) {
59
$this->query =
$query
;
60
$this->sort =
$sort
;
61
$this->limit =
$limit
;
62
$this->offset =
$offset
;
63
}
64
71
public
function
getQuery
()
72
{
73
if
(is_null($this->query)) {
75
$data = $this->
raw
(self::FIELD_QUERY);
76
if
(is_null($data)) {
77
return
null
;
78
}
79
80
$this->query =
SearchQueryModel::of
($data);
81
}
82
83
return
$this->query
;
84
}
85
92
public
function
getSort
()
93
{
94
if
(is_null($this->sort)) {
96
$data = $this->
raw
(self::FIELD_SORT);
97
if
(is_null($data)) {
98
return
null
;
99
}
100
$this->sort =
SearchSortingCollection::fromArray
($data);
101
}
102
103
return
$this->sort
;
104
}
105
112
public
function
getLimit
()
113
{
114
if
(is_null($this->limit)) {
116
$data = $this->
raw
(self::FIELD_LIMIT);
117
if
(is_null($data)) {
118
return
null
;
119
}
120
$this->limit = (int) $data;
121
}
122
123
return
$this->limit
;
124
}
125
132
public
function
getOffset
()
133
{
134
if
(is_null($this->offset)) {
136
$data = $this->
raw
(self::FIELD_OFFSET);
137
if
(is_null($data)) {
138
return
null
;
139
}
140
$this->offset = (int) $data;
141
}
142
143
return
$this->offset
;
144
}
145
146
150
public
function
setQuery
(?
SearchQuery
$query
): void
151
{
152
$this->query =
$query
;
153
}
154
158
public
function
setSort
(?
SearchSortingCollection
$sort
): void
159
{
160
$this->sort =
$sort
;
161
}
162
166
public
function
setLimit
(?
int
$limit
): void
167
{
168
$this->limit =
$limit
;
169
}
170
174
public
function
setOffset
(?
int
$offset
): void
175
{
176
$this->offset =
$offset
;
177
}
178
}
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel
Definition:
CustomerSearchRequestModel.php:24
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\getOffset
getOffset()
Definition:
CustomerSearchRequestModel.php:132
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\setSort
setSort(?SearchSortingCollection $sort)
Definition:
CustomerSearchRequestModel.php:158
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\$query
$query
Definition:
CustomerSearchRequestModel.php:29
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\getQuery
getQuery()
Definition:
CustomerSearchRequestModel.php:71
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\getLimit
getLimit()
Definition:
CustomerSearchRequestModel.php:112
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\$sort
$sort
Definition:
CustomerSearchRequestModel.php:35
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\setQuery
setQuery(?SearchQuery $query)
Definition:
CustomerSearchRequestModel.php:150
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\$limit
$limit
Definition:
CustomerSearchRequestModel.php:41
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\getSort
getSort()
Definition:
CustomerSearchRequestModel.php:92
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\setLimit
setLimit(?int $limit)
Definition:
CustomerSearchRequestModel.php:166
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\setOffset
setOffset(?int $offset)
Definition:
CustomerSearchRequestModel.php:174
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\$offset
$offset
Definition:
CustomerSearchRequestModel.php:47
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequestModel\__construct
__construct(?SearchQuery $query=null, ?SearchSortingCollection $sort=null, ?int $limit=null, ?int $offset=null)
Definition:
CustomerSearchRequestModel.php:53
Commercetools\Api\Models\Search\SearchQueryModel
Definition:
SearchQueryModel.php:21
Commercetools\Api\Models\Search\SearchSortingCollection
Definition:
SearchSortingCollection.php:22
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Api\Models\CustomerSearch\CustomerSearchRequest
Definition:
CustomerSearchRequest.php:17
Commercetools\Api\Models\Search\SearchQuery
Definition:
SearchQuery.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\CustomerSearch
Definition:
CustomerIndexingProgress.php:9
Generated by
1.9.1