Rename limit() variables with better names and add description.

This commit is contained in:
kj 2022-07-19 12:08:22 -04:00
parent f4eabe6d54
commit c57ca191b1

View File

@ -614,16 +614,19 @@ class Model {
/**
* Define LIMIT en la sentencia SQL.
*
* @param int $initial
* @param int $final
* @param int $offsetOrQuantity
* Define el las filas a ignorar o la cantidad a tomar en
* caso de que $quantity no esté definido.
* @param int $quantity
* Define la cantidad máxima de filas a tomar.
*
* @return Model
*/
public static function limit(int $initial, int $final = 0) : Model {
if ($final==0)
static::$querySelect['limit'] = $initial;
public static function limit(int $offsetOrQuantity, ?int $quantity = null) : Model {
if (is_null($quantity))
static::$querySelect['limit'] = $offsetOrQuantity;
else
static::$querySelect['limit'] = $initial.', '.$final;
static::$querySelect['limit'] = $offsetOrQuantity.', '.$quantity;
return new static();
}