1 | <?php |
||
28 | abstract class AbstractThemeManager extends AbstractManager { |
||
29 | |||
30 | use TwigEnvironmentTrait; |
||
31 | |||
32 | /** |
||
33 | * Index. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | private $index; |
||
38 | |||
39 | /** |
||
40 | * Constructor. |
||
41 | * |
||
42 | * @param Twig_Environment $twigEnvironment The Twig environment. |
||
43 | */ |
||
44 | public function __construct(Twig_Environment $twigEnvironment) { |
||
49 | |||
50 | /** |
||
51 | * Add the global. |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | public function addGlobal() { |
||
63 | |||
64 | /** |
||
65 | * Get the index. |
||
66 | * |
||
67 | * @return array Returns the index. |
||
68 | */ |
||
69 | protected function getIndex() { |
||
72 | |||
73 | /** |
||
74 | * Get a provider. |
||
75 | * |
||
76 | * @param string $name The name. |
||
77 | * @return ThemeProviderInterface Returns the theme provider in case of success, null otherwise. |
||
78 | */ |
||
79 | protected function getProvider($name) { |
||
87 | |||
88 | /** |
||
89 | * Initialize the index. |
||
90 | * |
||
91 | * @return array Returns the initialized index. |
||
92 | */ |
||
93 | abstract protected function initIndex(); |
||
94 | |||
95 | /** |
||
96 | * Set the index. |
||
97 | * |
||
98 | * @param array $index The index. |
||
99 | * @return ManagerInterface Returns this manager. |
||
100 | */ |
||
101 | protected function setIndex(array $index) { |
||
105 | |||
106 | /** |
||
107 | * Set a provider. |
||
108 | * |
||
109 | * @param mixed $name The name. |
||
110 | * @param ThemeProviderInterface $provider The provider. |
||
111 | * @return ManagerInterface Returns this manager. |
||
112 | */ |
||
113 | protected function setProvider($name, ThemeProviderInterface $provider) { |
||
123 | |||
124 | } |
||
125 |