Exemple #1
0
 public function getResultsByKeyword($keyword, CollectionInterface $collection)
 {
     $results = $this->searchByKeyword($keyword);
     if ($results) {
         $collection->load($results);
         return $collection;
     }
 }
Exemple #2
0
 public function paginateResult(CollectionInterface $collection, $page, $limit = 10)
 {
     $limit = intval(abs($limit));
     if (!$limit) {
         throw new \LogicException('Invalid item per page number, must be a positive number');
     }
     $this->paginate($collection->getTotalFound(), $page, $limit);
     return $this;
 }