/**
* A utility method that builds out the SQL for the LIMIT / OFFSET chunk of the SQL
*
* @param page the page that will be pulled, will affect the OFFSET
* @param perpage how many items per page, will affect the LIMIT
* @return string an SQL statement consisting of the LIMIT and OFFSET
*/
private function _buildLimitOffsetSQL($page,$perpage) {
$limit = (is_numeric($perpage) && $perpage>0) ? $perpage : 10;
$offset = (is_numeric($page) && $page>0) ? ($page-1)*$perpage : 0;
return "LIMIT $limit OFFSET $offset";
}