PluginProbe
Auto Alt Text / trunk
Auto Alt Text vtrunk
3.0.3 2.8.2 1.3.1 1.3.2 2.0.0 2.1.0 2.1.1 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.7.0 2.8.0 2.8.1 All 28 releases
auto-alt-text / src / App / Infrastructure / Repositories / ErrorLogRepositoryInterface.php

ErrorLogRepositoryInterface.php in Auto Alt Text trunk, at src/App/Infrastructure/Repositories/ErrorLogRepositoryInterface.php

61 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AATXT\App\Infrastructure\Repositories;
4
5 use AATXT\App\Domain\Entities\ErrorLog;
6
7 /**
8 * ErrorLog Repository Interface
9 *
10 * Defines the contract for persisting and retrieving ErrorLog entities.
11 * This interface follows the Repository Pattern to abstract data access.
12 */
13 interface ErrorLogRepositoryInterface
14 {
15 /**
16 * Save an error log to the database
17 *
18 * If the ErrorLog has an ID (is persisted), this should update the existing record.
19 * If the ErrorLog has no ID (is not persisted), this should create a new record.
20 *
21 * @param ErrorLog $log The error log entity to save
22 * @return void
23 */
24 public function save(ErrorLog $log): void;
25
26 /**
27 * Find all error logs
28 *
29 * Returns all error logs ordered by time descending (most recent first).
30 *
31 * @param int $limit Maximum number of records to retrieve (default: 100)
32 * @return ErrorLog[] Array of ErrorLog entities
33 */
34 public function findAll(int $limit = 100): array;
35
36 /**
37 * Find an error log by ID
38 *
39 * @param int $id The error log ID
40 * @return ErrorLog|null The ErrorLog entity if found, null otherwise
41 */
42 public function findById(int $id): ?ErrorLog;
43
44 /**
45 * Delete an error log by ID
46 *
47 * @param int $id The error log ID to delete
48 * @return bool True if deleted successfully, false otherwise
49 */
50 public function delete(int $id): bool;
51
52 /**
53 * Delete all error logs
54 *
55 * Removes all error log records from the database.
56 *
57 * @return int The number of records deleted
58 */
59 public function deleteAll(): int;
60 }
61