private function calcOffset($page) { if (empty($page)) { return 0; } return (intval($page) - 1) * $this->perPage; }