instances added god may help
This commit is contained in:
@@ -7,7 +7,7 @@ use MintyPHP\Repository\Support\RepoQuery;
|
||||
|
||||
class ApiAuditLogRepository
|
||||
{
|
||||
public static function create(array $data): int|false
|
||||
public function create(array $data): int|false
|
||||
{
|
||||
$id = DB::insert(
|
||||
'insert into api_audit_log (
|
||||
@@ -32,7 +32,7 @@ class ApiAuditLogRepository
|
||||
return $id ? (int) $id : false;
|
||||
}
|
||||
|
||||
public static function listPaged(array $filters): array
|
||||
public function listPaged(array $filters): array
|
||||
{
|
||||
$search = trim((string) ($filters['search'] ?? ''));
|
||||
$status = strtolower(trim((string) ($filters['status'] ?? '')));
|
||||
@@ -134,7 +134,7 @@ class ApiAuditLogRepository
|
||||
$normalized = [];
|
||||
if (is_array($rows)) {
|
||||
foreach ($rows as $row) {
|
||||
$item = self::normalizeRow($row);
|
||||
$item = $this->normalizeRow($row);
|
||||
if ($item !== null) {
|
||||
$normalized[] = $item;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class ApiAuditLogRepository
|
||||
];
|
||||
}
|
||||
|
||||
public static function find(int $id): ?array
|
||||
public function find(int $id): ?array
|
||||
{
|
||||
$row = DB::selectOne(
|
||||
'select
|
||||
@@ -181,10 +181,10 @@ class ApiAuditLogRepository
|
||||
(string) $id
|
||||
);
|
||||
|
||||
return self::normalizeRow($row);
|
||||
return $this->normalizeRow($row);
|
||||
}
|
||||
|
||||
public static function purgeOlderThanDays(int $days): int
|
||||
public function purgeOlderThanDays(int $days): int
|
||||
{
|
||||
if ($days <= 0) {
|
||||
return 0;
|
||||
@@ -197,7 +197,7 @@ class ApiAuditLogRepository
|
||||
return is_int($deleted) ? $deleted : 0;
|
||||
}
|
||||
|
||||
private static function normalizeRow(mixed $row): ?array
|
||||
private function normalizeRow(mixed $row): ?array
|
||||
{
|
||||
if (!is_array($row)) {
|
||||
return null;
|
||||
@@ -220,4 +220,3 @@ class ApiAuditLogRepository
|
||||
return $log;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user