diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-01-03 01:21:07 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-01-03 01:21:07 +0300 |
commit | 4d75a68f22ca986ef965915f709f6e0b4b63d04a (patch) | |
tree | ab8674f59b70c3e1a5b4296930db08c47b4c5f4b /lib/Model | |
parent | 384317bbefeed4bd501f0316cf96bd228c00bc63 (diff) |
size
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/SearchRequest.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Model/SearchRequest.php b/lib/Model/SearchRequest.php index e4a08f1..37ebce1 100644 --- a/lib/Model/SearchRequest.php +++ b/lib/Model/SearchRequest.php @@ -37,7 +37,7 @@ class SearchRequest implements \JsonSerializable { private $page = 0; /** @var int */ - private $count = 10; + private $size = 10; /** @@ -65,6 +65,7 @@ class SearchRequest implements \JsonSerializable { $this->search = trim(str_replace(' ', ' ', $this->search)); } + /** * @return int */ @@ -83,15 +84,15 @@ class SearchRequest implements \JsonSerializable { /** * @return int */ - public function getCount() { - return $this->count; + public function getSize() { + return $this->size; } /** - * @param int $count + * @param int $size */ - public function setCount($count) { - $this->count = $count; + public function setSize($size) { + $this->size = $size; } @@ -99,11 +100,10 @@ class SearchRequest implements \JsonSerializable { * @return array */ public function jsonSerialize() { - return [ 'search' => $this->getSearch(), 'page' => $this->getPage(), - 'count' => $this->getCount() + 'size' => $this->getSize() ]; } @@ -126,8 +126,7 @@ class SearchRequest implements \JsonSerializable { $request = new SearchRequest(); $request->setSearch(MiscService::get($arr, 'search', '')); $request->setPage(MiscService::get($arr, 'page', 0)); - $request->setCount(MiscService::get($arr, 'count', 10)); - + $request->setSize(MiscService::get($arr, 'size', 10)); return $request; } |