commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
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
114 public function getResults()
115 {
116 return $this->results;
117 }
118
125 public function getMeta()
126 {
127 return $this->meta;
128 }
129
134 public function withLimit(?int $limit)
135 {
136 $this->limit = $limit;
137
138 return $this;
139 }
140
145 public function withOffset(?int $offset)
146 {
147 $this->offset = $offset;
148
149 return $this;
150 }
151
156 public function withCount(?int $count)
157 {
158 $this->count = $count;
159
160 return $this;
161 }
162
167 public function withTotal(?int $total)
168 {
169 $this->total = $total;
170
171 return $this;
172 }
173
178 public function withResults(?BaseResourceCollection $results)
179 {
180 $this->results = $results;
181
182 return $this;
183 }
184
189 public function withMeta(?JsonObject $meta)
190 {
191 $this->meta = $meta;
192
193 return $this;
194 }
195
196
197 public function build(): PagedQueryResponse
198 {
199 return new PagedQueryResponseModel(
200 $this->limit,
201 $this->offset,
202 $this->count,
203 $this->total,
204 $this->results,
205 $this->meta
206 );
207 }
208
209 public static function of(): PagedQueryResponseBuilder
210 {
211 return new self();
212 }
213}