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