Rename limit() variables with better names and add description.
This commit is contained in:
parent
f4eabe6d54
commit
c57ca191b1
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user