1 | <?php |
||
20 | class CacheListener implements ListenerAggregateInterface |
||
21 | { |
||
22 | |||
23 | use ListenerAggregateTrait; |
||
24 | |||
25 | /** |
||
26 | * |
||
27 | * @var StorageInterface |
||
28 | */ |
||
29 | private $cache; |
||
30 | |||
31 | 2 | public function __construct(StorageInterface $cache) |
|
35 | |||
36 | /** |
||
37 | * @param EventManagerInterface $events |
||
38 | * @param int $priority |
||
39 | */ |
||
40 | 1 | public function attach(EventManagerInterface $events, $priority = 1) |
|
45 | |||
46 | /** |
||
47 | * Searches the cache for rendered markdown. |
||
48 | * |
||
49 | * @param \Zend\EventManager\Event $event |
||
50 | * @return mixed the rendered markdown, if found, false otherwise |
||
51 | * @throws \Zend\Cache\Exception\ExceptionInterface |
||
52 | */ |
||
53 | 1 | public function preRender(Event $event) |
|
69 | |||
70 | /** |
||
71 | * Saves the rendered markdown within the cache. |
||
72 | * |
||
73 | * @param \Zend\EventManager\Event $event |
||
74 | * @return mixed |
||
75 | * @throws \Zend\Cache\Exception\ExceptionInterface |
||
76 | */ |
||
77 | 1 | public function postRender(Event $event) |
|
86 | } |
||
87 |