Clone current read query and apply select to count(*)
So that we can use the same conditions to query item count.
public queryCount ( ) : integer | ||
리턴 | integer |
/** * Create collection pager object from collection. * * @param LazyRecord\BaseCollection collection object. * @return BootstrapRegionPager */ protected function createCollectionPager(BaseCollection $collection) { $page = $this->getCurrentPage(); $pageSize = $this->getCurrentPageSize(); $count = $collection->queryCount(); $collection->page($page, $pageSize); // return new RegionPager( $page, $count, $pageSize ); return new BootstrapRegionPager($page, $count, $pageSize); }