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. * Define LIMIT en la sentencia SQL.
* *
* @param int $initial * @param int $offsetOrQuantity
* @param int $final * 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 * @return Model
*/ */
public static function limit(int $initial, int $final = 0) : Model { public static function limit(int $offsetOrQuantity, ?int $quantity = null) : Model {
if ($final==0) if (is_null($quantity))
static::$querySelect['limit'] = $initial; static::$querySelect['limit'] = $offsetOrQuantity;
else else
static::$querySelect['limit'] = $initial.', '.$final; static::$querySelect['limit'] = $offsetOrQuantity.', '.$quantity;
return new static(); return new static();
} }