1 | <?php |
||
27 | abstract class AbstractThemeManager extends AbstractManager { |
||
28 | |||
29 | /** |
||
30 | * Index. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | private $index; |
||
35 | |||
36 | /** |
||
37 | * Twig service. |
||
38 | * |
||
39 | * @var Twig_Environment |
||
40 | */ |
||
41 | private $twig; |
||
42 | |||
43 | /** |
||
44 | * Constructor. |
||
45 | * |
||
46 | * @param Twig_Environment $twig The Twig service. |
||
47 | */ |
||
48 | public function __construct(Twig_Environment $twig) { |
||
53 | |||
54 | /** |
||
55 | * Add the global. |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | public function addGlobal() { |
||
67 | |||
68 | /** |
||
69 | * Get the index. |
||
70 | * |
||
71 | * @return array Returns the index. |
||
72 | */ |
||
73 | protected function getIndex() { |
||
76 | |||
77 | /** |
||
78 | * Get a provider. |
||
79 | * |
||
80 | * @param string $name The name. |
||
81 | * @return ThemeProviderInterface Returns the theme provider in case of success, null otherwise. |
||
82 | */ |
||
83 | protected function getProvider($name) { |
||
91 | |||
92 | /** |
||
93 | * Get the Twig. |
||
94 | * |
||
95 | * @return Twig_Environment Returns the Twig. |
||
96 | */ |
||
97 | public function getTwig() { |
||
100 | |||
101 | /** |
||
102 | * Initialize the index. |
||
103 | * |
||
104 | * @return array Returns the initialized index. |
||
105 | */ |
||
106 | abstract protected function initIndex(); |
||
107 | |||
108 | /** |
||
109 | * Set the index. |
||
110 | * |
||
111 | * @param array $index The index. |
||
112 | * @return ManagerInterface Returns this manager. |
||
113 | */ |
||
114 | protected function setIndex(array $index) { |
||
118 | |||
119 | /** |
||
120 | * Set a provider. |
||
121 | * |
||
122 | * @param mixed $name The name. |
||
123 | * @param ThemeProviderInterface $provider The provider. |
||
124 | * @return ManagerInterface Returns this manager. |
||
125 | */ |
||
126 | protected function setProvider($name, ThemeProviderInterface $provider) { |
||
136 | |||
137 | /** |
||
138 | * Set the Twig. |
||
139 | * |
||
140 | * @param Twig_Environment $twig The Twig. |
||
141 | * @return ManagerInterface Returns this manager. |
||
142 | */ |
||
143 | protected function setTwig(Twig_Environment $twig) { |
||
147 | |||
148 | } |
||
149 |