Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Template\Application\Service; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | /** |
| 12 | * Contract for resolving template variables and metadata catalogs. |
| 13 | * |
| 14 | * @package App\Core\Template\Application\Service |
| 15 | */ |
| 16 | interface TemplateVariableResolverInterface |
| 17 | { |
| 18 | /** |
| 19 | * Resolves complete template context variables for a specific record. |
| 20 | * |
| 21 | * @param string $moduleName Target module name. |
| 22 | * @param int|null $recordId Optional primary record identifier. |
| 23 | * @param array<string, mixed> $overrides Explicit variable overrides. |
| 24 | * @param array<string, mixed>|null $user Optional current user identity data. |
| 25 | * @return array<string, mixed> Hierarchical context dictionary for Twig rendering. |
| 26 | */ |
| 27 | public function resolveContext( |
| 28 | string $moduleName, |
| 29 | ?int $recordId = null, |
| 30 | array $overrides = [], |
| 31 | ?array $user = null |
| 32 | ): array; |
| 33 | |
| 34 | /** |
| 35 | * Resolves template context variables for a collection of records (list scope). |
| 36 | * |
| 37 | * @param string $moduleName Target module name. |
| 38 | * @param array<int> $recordIds Optional explicit list of record IDs. |
| 39 | * @param array<string, mixed>|null $user Optional current user identity data. |
| 40 | * @return array<string, mixed> Hierarchical context dictionary for Twig rendering. |
| 41 | */ |
| 42 | public function resolveListContext( |
| 43 | string $moduleName, |
| 44 | array $recordIds = [], |
| 45 | ?array $user = null |
| 46 | ): array; |
| 47 | |
| 48 | /** |
| 49 | * Returns categorized catalog of available variables for the visual Variable Picker UI. |
| 50 | * |
| 51 | * @param string $moduleName Target module machine name. |
| 52 | * @return array<string, mixed> Categorized variable tree. |
| 53 | */ |
| 54 | public function getAvailableVariables(string $moduleName): array; |
| 55 | } |