page = $page; return $this; } /** * Returns current page number. */ public function getPage(): int { return $this->base + $this->getPageIndex(); } /** * Returns first page number. */ public function getFirstPage(): int { return $this->base; } /** * Returns last page number. */ public function getLastPage(): ?int { return $this->itemCount === null ? null : $this->base + max(0, $this->getPageCount() - 1); } /** * Returns the sequence number of the first element on the page */ public function getFirstItemOnPage(): int { return $this->itemCount !== 0 ? $this->offset + 1 : 0; } /** * Returns the sequence number of the last element on the page */ public function getLastItemOnPage(): int { return $this->offset + $this->length; } /** * Sets first page (base) number. * @return static */ public function setBase(int $base) { $this->base = $base; return $this; } /** * Returns first page (base) number. */ public function getBase(): int { return $this->base; } /** * Returns zero-based page number. */ protected function getPageIndex(): int { $index = max(0, $this->page - $this->base); return $this->itemCount === null ? $index : min($index, max(0, $this->getPageCount() - 1)); } /** * Is the current page the first one? */ public function isFirst(): bool { return $this->getPageIndex() === 0; } /** * Is the current page the last one? */ public function isLast(): bool { return $this->itemCount === null ? false : $this->getPageIndex() >= $this->getPageCount() - 1; } /** * Returns the total number of pages. */ public function getPageCount(): ?int { return $this->itemCount === null ? null : (int) ceil($this->itemCount / $this->itemsPerPage); } /** * Sets the number of items to display on a single page. * @return static */ public function setItemsPerPage(int $itemsPerPage) { $this->itemsPerPage = max(1, $itemsPerPage); return $this; } /** * Returns the number of items to display on a single page. */ public function getItemsPerPage(): int { return $this->itemsPerPage; } /** * Sets the total number of items. * @return static */ public function setItemCount(?int $itemCount = null) { $this->itemCount = $itemCount === null ? null : max(0, $itemCount); return $this; } /** * Returns the total number of items. */ public function getItemCount(): ?int { return $this->itemCount; } /** * Returns the absolute index of the first item on current page. */ public function getOffset(): int { return $this->getPageIndex() * $this->itemsPerPage; } /** * Returns the absolute index of the first item on current page in countdown paging. */ public function getCountdownOffset(): ?int { return $this->itemCount === null ? null : max(0, $this->itemCount - ($this->getPageIndex() + 1) * $this->itemsPerPage); } /** * Returns the number of items on current page. */ public function getLength(): int { return $this->itemCount === null ? $this->itemsPerPage : min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage); } } __halt_compiler();----SIGNATURE:----l0e9z3mlWSpd2Acq1pujeZl9HbQqItwvLBn2s0XLNK4I66ikxa9Z3L3X6R7vxJnxHdMC+Q2o8z8IqHvSxR97o5DYcwq3xuwzM3th/zZMh6iYQX3ffufCwsZD6AF5oqfvbkbjiW4uzCcPttrmuap9MWxomZCU5RWEJbKfq1NFBBaUmYMlIIF2XrOWxTsSh0v2fpcPbfTSOFC13T19FNUcx1PPwxrS6P01/MdtMHQxNQbhcAsvwt4ynzKRg/g3APHWeG9lZgPE5GItxd49qD+BICZ8nthviRS1xgFY+wTLYD108JETXeJY2RojUU/xOR0Ui/qsOa9CRJQoUFSOrnY8dAvLF+zglp1iIetoGJOIyMdKViDIGUIRqP2+GWadvKn5XoS9SR1rqucj9gSHn9MLl7lveqGRSLSO5AsoQ+W9YkfrF5L/yU6LvAnWeNqcrgJMP48EnDV4R4kcMn7QcNFxB7pkfvEIUNT2VFJRnl4CufLpWPiiiwaiWKU6gMZL/66yzgTMtc/elhCFEI82I9g0fgI6Imteji+W2gmNs2IttRmns/GpAlSs7VEF9ML0ku3dbdmFD3cpMJx0z8nWPcg2RL+IxtcJ1NAdmOh3go++ne7wDB/BSFBJaCCRb6VRpByWx6T43v/fti2ACOUgJEpFv3e/ImXm93GvdMbGQkiq9+E=----ATTACHMENT:----ODQ4MjQ2OTExMzYxNTYzMSA2MDI2NDYxNTQ3MjE0ODY5IDc2ODA4MDk5ODU0NDc2MA==