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/**
4 * Interface for Forms repository.
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public License,
7 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
8 * obtain one at https://mozilla.org/MPL/2.0/.
9 *
10 * @package   phpMyFAQ
11 * @author    Thorsten Rinne <thorsten@phpmyfaq.de>
12 * @author    Jan Harms <model_railroader@gmx-topmail.de>
13 * @copyright 2025-2026 phpMyFAQ Team
14 * @license   https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
15 * @link      https://www.phpmyfaq.de
16 * @since     2025-11-04
17 */
18
19declare(strict_types=1);
20
21namespace phpMyFAQ\Form;
22
23interface FormsRepositoryInterface
24{
25    /** @return array<int, \stdClass> */
26    public function fetchFormDataByFormId(int $formId): array;
27
28    public function updateInputActive(int $formId, int $inputId, int $activated): bool;
29
30    public function updateInputRequired(int $formId, int $inputId, int $required): bool;
31
32    /** @return array<int, \stdClass> */
33    public function fetchTranslationsByFormAndInput(int $formId, int $inputId): array;
34
35    public function updateTranslation(string $label, int $formId, int $inputId, string $lang): bool;
36
37    public function deleteTranslation(int $formId, int $inputId, string $lang): bool;
38
39    public function fetchDefaultInputData(int $formId, int $inputId): ?\stdClass;
40
41    public function insertTranslationRow(
42        int $formId,
43        int $inputId,
44        string $inputType,
45        string $label,
46        int $inputActive,
47        int $inputRequired,
48        string $langCode,
49    ): bool;
50
51    /**
52     * @param array<string, mixed> $input
53     */
54    public function insertInput(array $input): bool;
55
56    /**
57     * @param array<string, mixed> $input
58     */
59    public function buildInsertQuery(array $input): string;
60}