/** * Calculate the total number of pages for all of the listings. Store the page count in the page_count property of the object. * @param int|null $rec_count Overrides internal record count value. */ public function calcPageCount($rec_count = null) { if ($rec_count !== null) { $this->recordCount = $rec_count; } $page_len = $this->listingsLength->value; if ($page_len === null) { $page_len = $this->recordCount; } $this->pageCount = PageUtils::calculateRowCount($this->recordCount, $page_len); }
/** * Appends a trailing slash. * Will remove trailing forward and backslashes if it exists already before adding * a trailing forward slash. This prevents double slashing a string or path. * The primary use of this is for paths and thus should be used for paths. It is * not restricted to paths and offers no specific path support. * @param string $string What to add the trailing slash to. * @return string String with trailing slash added. */ public static function trailingSlashIt($string) { return PageUtils::untrailingSlashIt($string) . '/'; }