Skeleton is ready
This commit is contained in:
12
app/Kernel/Db/Ilike.php
Normal file
12
app/Kernel/Db/Ilike.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Kernel\Db;
|
||||
|
||||
enum Ilike: string
|
||||
{
|
||||
case StartsWith = '%s%%%%';
|
||||
case EndsWith = '%%%s';
|
||||
case Contains = '%%%%%s%%%%';
|
||||
}
|
||||
16
app/Kernel/Db/Query.php
Normal file
16
app/Kernel/Db/Query.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Kernel\Db;
|
||||
|
||||
class Query
|
||||
{
|
||||
public static function ilike(
|
||||
int|float|string $value,
|
||||
string $modifier = '%s',
|
||||
Ilike $mode = Ilike::Contains
|
||||
): string {
|
||||
return sprintf(sprintf($mode->value, $modifier), $value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user