-
Notifications
You must be signed in to change notification settings - Fork 1
Is Greater Than Equal To
Gilberto Junior edited this page Nov 29, 2019
·
7 revisions
A operator that represents the field's value is greater than another value.
public function isGreaterThan(string $column, string|int|float $value): self;
public function gt(string $column, string|int|float $value): self;
PHP's way:
$repository->isGreaterThan('age', 18);
SQL's Representation:
WHERE age > 18;
PHP's way:
$repository->gt('price', 1.99);
SQL's Representation:
WHERE price > 1.99;
PHP's way:
$repository->isGreaterThan('age', 18)
->orIsGreaterThan('birth_date', '2019-10-02');
SQL's Representation:
WHERE age > 18 OR birth_date > '2019-10-02';
PHP's way:
$repository->gt('price', 0.01)
->orGt('id', 999);
SQL's Representation:
WHERE price > 0.01 OR id > 999;
A operator that represents the field's value is greater than equal to another value.
public function isGreaterThanEqualTo(string $column, string|int|float $value): self;
public function gte(string $column, string|int|float $value): self;
PHP's way:
$repository->isGreaterThanEqualTo('id', 10);
SQL's Representation:
WHERE id >= 10;
PHP's way:
$repository->gte('size', 999);
SQL's Representation:
WHERE size >= 999;
PHP's way:
$repository->isGreaterThanEqualTo('price', 100)
->orIsGreaterThanEqualTo('quantity', 999);
SQL's Representation:
WHERE price >= 100 OR quantity >= 999;
PHP's way:
$repository->gte('score', 1000)
->orGte('age', 18);
SQL's Representation:
WHERE score >= 1000 OR age >= 18;
by c0dehappy