|array $items 현재 페이지 항목 * @param int $total 총 건수 (상한 초과 시 상한값) * @param int $perPage 페이지당 건수 * @param int $currentPage 현재 페이지 번호 * @param TotalRelation $totalRelation 총 건수 정확도 * @param int|null $resultCap 적용된 상한 (무제한이면 null) * @param bool $hasMorePages 다음 페이지 존재 여부 (per_page + 1 실측) * @param array $options 페이지네이터 옵션 (path, pageName 등) */ public function __construct( $items, int $total, int $perPage, int $currentPage, TotalRelation $totalRelation, ?int $resultCap, bool $hasMorePages, array $options = [] ) { parent::__construct($items, $total, $perPage, $currentPage, $options); $this->totalRelation = $totalRelation; $this->resultCap = $resultCap; $this->probedHasMorePages = $hasMorePages; } /** * 총 건수와 실제 매칭 건수의 관계를 반환합니다. * * @return TotalRelation 정확(Exact) 또는 하한(AtLeast) */ public function totalRelation(): TotalRelation { return $this->totalRelation; } /** * 총 건수 집계에 적용된 상한을 반환합니다. * * @return int|null 상한 (무제한이면 null) */ public function resultCap(): ?int { return $this->resultCap; } /** * 총 건수가 상한에 걸려 잘렸는지 여부를 반환합니다. * * @return bool 잘렸으면 true */ public function isTruncated(): bool { return ! $this->totalRelation->isExact(); } /** * 마지막 페이지 번호를 반환합니다. * * 총 건수가 부정확하면 마지막 페이지를 계산할 수 없으므로 null 을 반환합니다. * 화면은 이 값이 null 이면 마지막 페이지 점프 버튼을 감춥니다. * * @return int|null 마지막 페이지 번호 (총 건수 부정확 시 null) */ public function lastPage(): ?int { return $this->isTruncated() ? null : $this->lastPage; } /** * 다음 페이지 존재 여부를 반환합니다. * * 총 건수를 몰라도 `per_page + 1` 조회로 정확히 판정되므로, 상한에 걸린 상태에서도 * "다음" 이동은 끝까지 열려 있습니다. * * @return bool 다음 페이지가 있으면 true */ public function hasMorePages(): bool { return $this->probedHasMorePages; } }