1 | <?php |
||
17 | class TemplateManager |
||
18 | { |
||
19 | /** |
||
20 | * List of templates |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $templates = []; |
||
25 | |||
26 | /** |
||
27 | * TemplateManager constructor. |
||
28 | * |
||
29 | * @param TemplateInterface[] $templates |
||
30 | */ |
||
31 | public function __construct(array $templates) |
||
37 | |||
38 | /** |
||
39 | * List all available templates |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | public function listTemplates(): array |
||
47 | |||
48 | /** |
||
49 | * List all available templates for choice using names |
||
50 | * |
||
51 | * @return array |
||
52 | */ |
||
53 | public function listTemplatesChoice(): array |
||
63 | |||
64 | /** |
||
65 | * Get template |
||
66 | * |
||
67 | * @param string $slug |
||
68 | * |
||
69 | * @return string|null |
||
70 | */ |
||
71 | public function getTemplateClass(string $slug): string |
||
79 | |||
80 | /** |
||
81 | * Get email template name |
||
82 | * |
||
83 | * @param string $slug |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getTemplateName(string $slug): string |
||
98 | |||
99 | /** |
||
100 | * Get template description |
||
101 | * |
||
102 | * @param string $slug |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getTemplateDescription(string $slug): string |
||
113 | |||
114 | /** |
||
115 | * Get template parameters |
||
116 | * |
||
117 | * @param string $slug |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getTemplateParameters(string $slug): string |
||
138 | } |
||
139 |