← All changes
|
backend/src/Repository/Confirmation/ConfirmationRepositoryInterface.php
+56
-0
0.6.1
→
1.5.1
View file →
| @@ -1,0 +1,56 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace IvyForms\Repository\Confirmation; | |
| 4 | + | |
| 5 | +// phpcs:disable PSR1.Files.SideEffects | |
| 6 | +if (!defined('ABSPATH')) { | |
| 7 | + exit; // Exit if accessed directly | |
| 8 | +} | |
| 9 | + | |
| 10 | +use IvyForms\Repository\BaseRepositoryInterface; | |
| 11 | + | |
| 12 | +interface ConfirmationRepositoryInterface extends BaseRepositoryInterface | |
| 13 | +{ | |
| 14 | + /** | |
| 15 | + * Get all confirmations by ID. | |
| 16 | + * | |
| 17 | + * @param int $id | |
| 18 | + * | |
| 19 | + * @return array<mixed> | |
| 20 | + */ | |
| 21 | + public function getAllById(int $id): array; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * Count confirmations for a form. | |
| 25 | + * | |
| 26 | + * @param int $formId | |
| 27 | + * @return int | |
| 28 | + */ | |
| 29 | + public function countByFormId(int $formId): int; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * Get the next position value for a new confirmation on a form. | |
| 33 | + * | |
| 34 | + * @param int $formId | |
| 35 | + * @return int | |
| 36 | + */ | |
| 37 | + public function getNextPosition(int $formId): int; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * Update positions for confirmations on a form. | |
| 41 | + * | |
| 42 | + * @param int $formId | |
| 43 | + * @param array<int, int> $orderedIds Confirmation IDs in desired order | |
| 44 | + * @return void | |
| 45 | + */ | |
| 46 | + public function updatePositions(int $formId, array $orderedIds): void; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * Set which confirmation is the default for a form. | |
| 50 | + * | |
| 51 | + * @param int $formId | |
| 52 | + * @param int $defaultConfirmationId | |
| 53 | + * @return void | |
| 54 | + */ | |
| 55 | + public function syncDefaultFlag(int $formId, int $defaultConfirmationId): void; | |
| 56 | +} | |