Example #1
0
 /**
  * Paginar
  *
  * @param  array     $params
  * @param  int       $page    numero de pagina
  * @param  int       $perPage cantidad de items por pagina
  * @param  array     $values  valores
  * @return Paginator
  */
 public static function paginate(array $params, $page, $perPage, $values = null)
 {
     unset($params['limit'], $params['offset']);
     $sql = QueryGenerator::select(static::getSource(), static::getDriver(), $params);
     // Valores para consulta
     if ($values !== null && !\is_array($values)) {
         $values = \array_slice(func_get_args(), 3);
     }
     return new Paginator(\get_called_class(), $sql, (int) $page, (int) $perPage, $values);
 }