Ejemplo n.º 1
0
 protected function findEntities($sql, array $params = [], $limit = null, $offset = null)
 {
     if (isset($_GET['page']) && isset($_GET['per_page']) && !empty($_GET['page']) && !empty($_GET['per_page'])) {
         $limit = (int) $_GET['per_page'];
         $page = (int) $_GET['page'];
         if ($limit > 0 && $page > 0) {
             $offset = ($page - 1) * $limit;
         } else {
             $limit = null;
         }
     }
     return parent::findEntities($sql, $params, $limit, $offset);
 }