-
Notifications
You must be signed in to change notification settings - Fork 1
Is Less Than Equal To
Gilberto Junior edited this page Nov 29, 2019
·
3 revisions
A operator that represents the field's value is less than another value.
public function isLessThan(string $column, string|int|float $value): self;
public function lt(string $column, string|int|float $value): self;
PHP's way:
$repository->isLessThan('age', 18);
SQL's Representation:
WHERE age < 18;
PHP's way:
$repository->lt('price', 199.99);
SQL's Representation:
WHERE price < 199.99;
PHP's way:
$repository->isLessThan('age', 18)
->orIsLessThan('birth_date', '2019-10-02');
SQL's Representation:
WHERE age <= 18 OR birth_date <= '2019-10-02';
PHP's way:
$repository->lt('price', 0.01)
->orLt('id', 999);
SQL's Representation:
WHERE price < 0.01 OR id < 999;
A operator that represents the field's value is less than equal to another value.
public function isLessThanEqualTo(string $column, string|int|float $value): self;
public function lte(string $column, string|int|float $value): self;
PHP's way:
$repository->isLessThanEqualTo('id', 10);
SQL's Representation:
WHERE id <= 10;
PHP's way:
$repository->lte('size', 999);
SQL's Representation:
WHERE size <= 999;
PHP's way:
$repository->isLessThanEqualTo('price', 100)
->orIsLessThanEqualTo('quantity', 999);
SQL's Representation:
WHERE price <= 100 OR quantity <= 999;
PHP's way:
$repository->lte('score', 1000)
->orLte('age', 18);
SQL's Representation:
WHERE score <= 1000 OR age <= 18;
by c0dehappy