-
Notifications
You must be signed in to change notification settings - Fork 1
Like Or Not
Gilberto Junior edited this page Nov 29, 2019
·
1 revision
A operator that compares strings.
public function like(string $column, string $value): self;
PHP's way:
$repository->like('name', 'Joe Doe');
SQL's Representation:
WHERE name LIKE 'Joe Doe';
PHP's way:
$repository->like('name', 'Joe%');
SQL's Representation:
WHERE name LIKE 'Joe%';
PHP's way:
$repository->like('name', '%Doe');
SQL's Representation:
WHERE name LIKE '%Doe';
PHP's way:
$repository->like('name', '%oe%');
SQL's Representation:
WHERE name LIKE '%oe%';
The opposite of LIKE
.
public function notLike(string $column, string $value): self;
PHP's way:
$repository->notLike('name', 'Joe Doe');
SQL's Representation:
WHERE name LIKE 'Joe Doe';
PHP's way:
$repository->notLike('name', 'Joe%');
SQL's Representation:
WHERE name NOT LIKE 'Joe%';
PHP's way:
$repository->notLike('name', '%Doe');
SQL's Representation:
WHERE name NOT LIKE '%Doe';
PHP's way:
$repository->notLike('name', '%oe%');
SQL's Representation:
WHERE name NOT LIKE '%oe%';
by c0dehappy