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.
|
||||
*
|
||||
* @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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user