commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PagedQueryResponseBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class PagedQueryResponseBuilder implements Builder
22{
27 private $limit;
28
33 private $offset;
34
39 private $count;
40
45 private $total;
46
51 private $results;
52
57 private $meta;
58
65 public function getLimit()
66 {
67 return $this->limit;
68 }
69
76 public function getOffset()
77 {
78 return $this->offset;
79 }
80
87 public function getCount()
88 {
89 return $this->count;
90 }
91
102 public function getTotal()
103 {
104 return $this->total;
105 }
106
111 public function getResults()
112 {
113 return $this->results;
114 }
115
120 public function getMeta()
121 {
122 return $this->meta;
123 }
124
129 public function withLimit(?int $limit)
130 {
131 $this->limit = $limit;
132
133 return $this;
134 }
135
140 public function withOffset(?int $offset)
141 {
142 $this->offset = $offset;
143
144 return $this;
145 }
146
151 public function withCount(?int $count)
152 {
153 $this->count = $count;
154
155 return $this;
156 }
157
162 public function withTotal(?int $total)
163 {
164 $this->total = $total;
165
166 return $this;
167 }
168
173 public function withResults(?BaseResourceCollection $results)
174 {
175 $this->results = $results;
176
177 return $this;
178 }
179
184 public function withMeta(?JsonObject $meta)
185 {
186 $this->meta = $meta;
187
188 return $this;
189 }
190
191
192 public function build(): PagedQueryResponse
193 {
194 return new PagedQueryResponseModel(
195 $this->limit,
196 $this->offset,
197 $this->count,
198 $this->total,
199 $this->results,
200 $this->meta
201 );
202 }
203
204 public static function of(): PagedQueryResponseBuilder
205 {
206 return new self();
207 }
208}