1 | <?php |
||
9 | class PageBreakpointService { |
||
10 | |||
11 | /** |
||
12 | * @var array The templates paths |
||
13 | */ |
||
14 | protected $templatesPathStack = array(); |
||
15 | |||
16 | /** |
||
17 | * @var array The assets manager paths |
||
18 | */ |
||
19 | protected $assetsManagerPathStack = array(); |
||
20 | |||
21 | /** |
||
22 | * Smarty object |
||
23 | * |
||
24 | * @var Smarty |
||
25 | */ |
||
26 | protected $smarty; |
||
27 | |||
28 | /** |
||
29 | * Retrieve paths to templates |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | public function getTemplatesPathStack() { |
||
36 | |||
37 | /** |
||
38 | * Set the templates paths |
||
39 | * |
||
40 | * @param array $templatesPathStack |
||
41 | */ |
||
42 | public function setTemplatesPathStack(Array $templatesPathStack) { |
||
45 | |||
46 | /** |
||
47 | * Retrieve paths to assets manager |
||
48 | * |
||
49 | * @return array |
||
50 | */ |
||
51 | function getAssetsManagerPathStack() { |
||
54 | |||
55 | /** |
||
56 | * Set the assets manager paths |
||
57 | * |
||
58 | * @param array $assetsManagerPathStack |
||
59 | */ |
||
60 | function setAssetsManagerPathStack($assetsManagerPathStack) { |
||
63 | |||
64 | /** |
||
65 | * Return Smarty Object |
||
66 | * |
||
67 | * @return Smarty |
||
68 | */ |
||
69 | function getSmarty() { |
||
72 | |||
73 | /** |
||
74 | * Set the Smarty Object |
||
75 | * @param Smarty $smarty |
||
76 | */ |
||
77 | function setSmarty(Smarty $smarty) { |
||
80 | |||
81 | /** |
||
82 | * Constructor |
||
83 | * |
||
84 | * @param Smarty $smarty |
||
85 | * @param array $templatesPathStack |
||
86 | * @param array $assetsManagerPathStack |
||
87 | */ |
||
88 | function __construct(Smarty $smarty, $templatesPathStack, $assetsManagerPathStack) { |
||
93 | |||
94 | /** |
||
95 | * Creats a PageBreakpoint file if not exist |
||
96 | * |
||
97 | * @param int $idPage |
||
98 | * @param array $extraData |
||
99 | * @param string $hash |
||
100 | * @param array $images |
||
101 | * @param array $imageSizesGroups |
||
102 | * @return string |
||
103 | */ |
||
104 | public function createPageBreakpoint($idPage, $extraData, $hash, $images, $imageSizesGroups) { |
||
124 | |||
125 | /** |
||
126 | * Sets the path to pageBreakpoint object |
||
127 | * |
||
128 | * @param PageBreakpoint $pageBreakpoint |
||
129 | */ |
||
130 | protected function loadBreakpointsPath(PageBreakpoint &$pageBreakpoint) { |
||
136 | |||
137 | /** |
||
138 | * Check Breakpoints directory, if not exist create it |
||
139 | * |
||
140 | * @param PageBreakpoint $pageBreakpoint |
||
141 | * @return boolean |
||
142 | */ |
||
143 | protected function checkBreakpointPath(PageBreakpoint &$pageBreakpoint) { |
||
151 | |||
152 | /** |
||
153 | * Search on breakpoints dir the current breakpoint page file |
||
154 | * |
||
155 | * @param int $idPage |
||
156 | * @param PageBreakpoint $pageBreakpoint |
||
157 | * @return boolean |
||
158 | */ |
||
159 | protected function getCurrentBreakpointFilename($idPage, PageBreakpoint $pageBreakpoint) { |
||
167 | |||
168 | /** |
||
169 | * Get the template file hash |
||
170 | * |
||
171 | * @return string |
||
172 | */ |
||
173 | protected function getBreakpointTemplateHash() { |
||
181 | |||
182 | /** |
||
183 | * Create a new PageBreakpointFile |
||
184 | * |
||
185 | * @param PageBreakpoint $pageBreakpoint |
||
186 | */ |
||
187 | protected function createBreakpointFile(PageBreakpoint $pageBreakpoint) { |
||
207 | |||
208 | /** |
||
209 | * Remove the last breakpoint file |
||
210 | * |
||
211 | * @param PageBreakpoint $pageBreakpoint |
||
212 | * @param string $currentFileName |
||
213 | */ |
||
214 | protected function invalidateCurrentBreakpointFile(PageBreakpoint $pageBreakpoint, $currentFileName) { |
||
226 | } |
||
227 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.