1 | <?php |
||
13 | class CachableBaseComponent extends BaseComponent |
||
14 | { |
||
15 | const DEFAULT_MAXAGE = 'P7D'; |
||
16 | |||
17 | const PARAMETER_CACHABLE = 'cachable'; |
||
18 | const PARAMETER_MAXAGE = 'maxage'; |
||
19 | |||
20 | protected $cachable = true; |
||
21 | protected $maxAge = self::DEFAULT_MAXAGE; |
||
22 | protected $cacheValidity; |
||
23 | protected $cache; |
||
24 | |||
25 | /** |
||
26 | * CachableBaseComponent constructor. |
||
27 | * @param string $template |
||
28 | * @param Request $request |
||
29 | * @param array $parameters |
||
30 | * @param $matchedSitemapItem |
||
31 | */ |
||
32 | public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem) |
||
46 | |||
47 | public function get() |
||
56 | |||
57 | |||
58 | /** |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function isCachable() |
||
65 | |||
66 | /** |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function isCacheValid() |
||
79 | |||
80 | private function isLoggedIn() |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getMaxAge() |
||
92 | |||
93 | protected function setCacheValidity() |
||
111 | |||
112 | private function createCache($renderedContent) |
||
116 | |||
117 | } |