Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Repositories\interfaces; |
| 4 | |
| 5 | use App\Http\Models\UserFieldInjection; |
| 6 | |
| 7 | /** |
| 8 | * Interface for user field injection data access operations. |
| 9 | * |
| 10 | * Abstracts database queries for per-user field injection customizations. |
| 11 | */ |
| 12 | interface IUserFieldInjectionRepository |
| 13 | { |
| 14 | /** |
| 15 | * Find a user's field injection config. |
| 16 | * |
| 17 | * @param string $userId The user ID |
| 18 | * @return UserFieldInjection|null The user's config or null if none exists |
| 19 | */ |
| 20 | public function findByUserId(string $userId): ?UserFieldInjection; |
| 21 | |
| 22 | /** |
| 23 | * Create or update a user's field injection config. |
| 24 | * |
| 25 | * @param string $userId The user ID |
| 26 | * @param array<string, mixed> $data The data to upsert |
| 27 | * @return UserFieldInjection The created or updated config |
| 28 | */ |
| 29 | public function upsert(string $userId, array $data): UserFieldInjection; |
| 30 | |
| 31 | /** |
| 32 | * Delete a user's field injection config entirely. |
| 33 | * |
| 34 | * @param string $userId The user ID |
| 35 | * @return bool True if deleted, false if not found |
| 36 | */ |
| 37 | public function deleteByUserId(string $userId): bool; |
| 38 | } |