/** * Create a new paginator instance. * * @param \Elodex\SearchResult $searchResult * @param int $perPage * @param int|null $currentPage * @param array $options (path, query, fragment, pageName) */ public function __construct($searchResult, $perPage, $currentPage = null, array $options = []) { $this->searchResult = $searchResult; $total = $this->searchResult->totalHits(); $items = $this->searchResult->getDocuments(); parent::__construct($items, $total, $perPage, $currentPage, $options); }
/** * Create a new paginator instance. * * @param mixed $items * @param int $total * @param int $perPage * @param int|null $currentPage * @param array $options (path, query, fragment, pageName) * @return void */ public function __construct($items, $total, $perPage, $currentPage = null, array $options = []) { parent::__construct($items, $total, $perPage, $currentPage, $options); foreach (request()->query->all() as $key => $param) { $this->addQuery($key, $param); } }
/** * PlasticPaginator constructor. * * @param PlasticResult $result * @param int $limit * @param int $page */ public function __construct(PlasticResult $result, $limit, $page) { $this->result = $result; parent::__construct($result->hits(), $result->totalHits(), $limit, $page, ['path' => LengthAwarePaginator::resolveCurrentPath()]); $hitsReference =& $this->items; $result->setHits($hitsReference); }
/** * Create a new paginator instance. * * @param mixed $items * @param int $total * @param int $perPage * @param int|null $currentPage * @param array $options (path, query, fragment, pageName) * @return void */ public function __construct($items, $total, $perPage, $currentPage = null, array $options = []) { parent::__construct($items, $total, $perPage, $currentPage, $options); /* * The original paginator always adds a trailing slash. * So we have to overwrite the $path variable with the path without a trailing slash. */ $this->path = Request::url(); }
public function __construct($items, $total, $perPage, $currentPage = null, array $options = []) { parent::__construct($items, $total, $perPage, $currentPage, $options); }
/** * Create a new paginator instance. * * @param mixed $items * @param int $total * @param int $perPage * @param array $aggregations * @param int|null $currentPage * @param array $options (path, query, fragment, pageName) * @return void */ public function __construct($items, $total, $perPage, $aggregations, $currentPage = null, array $options = []) { $this->aggregations = $aggregations; parent::__construct($items, $total, $perPage, $currentPage, $options); }