1 | <?php namespace Arcanesoft\Blog\ViewComposers; |
||
15 | abstract class AbstractComposer |
||
16 | { |
||
17 | /* ------------------------------------------------------------------------------------------------ |
||
18 | | Properties |
||
19 | | ------------------------------------------------------------------------------------------------ |
||
20 | */ |
||
21 | /** |
||
22 | * Caching time. |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $cacheMinutes = 5; |
||
27 | |||
28 | /* ------------------------------------------------------------------------------------------------ |
||
29 | | Main Functions |
||
30 | | ------------------------------------------------------------------------------------------------ |
||
31 | */ |
||
32 | /** |
||
33 | * Get the cached posts. |
||
34 | * |
||
35 | * @return \Illuminate\Database\Eloquent\Collection |
||
36 | */ |
||
37 | protected function cachedPosts() |
||
43 | |||
44 | /** |
||
45 | * Get the cached categories. |
||
46 | * |
||
47 | * @return \Illuminate\Database\Eloquent\Collection |
||
48 | */ |
||
49 | protected function cachedCategories() |
||
55 | |||
56 | /** |
||
57 | * Get the cached tags. |
||
58 | * |
||
59 | * @return \Illuminate\Database\Eloquent\Collection |
||
60 | */ |
||
61 | protected function cachedTags() |
||
67 | |||
68 | /* ------------------------------------------------------------------------------------------------ |
||
69 | | Other Functions |
||
70 | | ------------------------------------------------------------------------------------------------ |
||
71 | */ |
||
72 | /** |
||
73 | * Cache the results. |
||
74 | * |
||
75 | * @param string $name |
||
76 | * @param \Closure $callback |
||
77 | * |
||
78 | * @return mixed |
||
79 | */ |
||
80 | protected function cacheResults($name, Closure $callback) |
||
84 | } |
||
85 |