@@ 196-209 (lines=14) @@ | ||
193 | * |
|
194 | * @param int|null $page |
|
195 | */ |
|
196 | public function setPage($page) |
|
197 | { |
|
198 | if ($page === null) { |
|
199 | $page = self::DEFAULT_PAGE; |
|
200 | } |
|
201 | ||
202 | try { |
|
203 | $this->page = $this->validateNumeric($page); |
|
204 | } catch (InvalidArgumentException $e) { |
|
205 | throw new InvalidArgumentException('Invalid value for page parameter.', $e->getCode(), $e); |
|
206 | } |
|
207 | ||
208 | return $this; |
|
209 | } |
|
210 | ||
211 | /** |
|
212 | * Returns maximum results per page. |
|
@@ 227-240 (lines=14) @@ | ||
224 | * |
|
225 | * @param int|nul $maxResults |
|
226 | */ |
|
227 | public function setMaxResults($maxResults) |
|
228 | { |
|
229 | if ($maxResults === null) { |
|
230 | $maxResults = self::DEFAULT_MAX_RESULTS; |
|
231 | } |
|
232 | ||
233 | try { |
|
234 | $this->maxResults = $this->validateNumeric($maxResults); |
|
235 | } catch (InvalidArgumentException $e) { |
|
236 | throw new InvalidArgumentException('Invalid value for maxResults parameter.', $e->getCode(), $e); |
|
237 | } |
|
238 | ||
239 | return $this; |
|
240 | } |
|
241 | ||
242 | /** |
|
243 | * Returns include fields. |