@@ 142-156 (lines=15) @@ | ||
139 | return $list; |
|
140 | } |
|
141 | ||
142 | public static function getCachedBySlug($slug) |
|
143 | { |
|
144 | $data = self::findFirst([ |
|
145 | 'slug = :slug:', |
|
146 | 'bind' => [ |
|
147 | 'slug' => $slug, |
|
148 | ], |
|
149 | 'cache' => [ |
|
150 | 'key' => self::cacheSlugKey($slug), |
|
151 | 'lifetime' => 86400, |
|
152 | ] |
|
153 | ]); |
|
154 | ||
155 | return $data; |
|
156 | } |
|
157 | ||
158 | public static function cacheSlugKey($slug) |
|
159 | { |
@@ 107-115 (lines=9) @@ | ||
104 | $this->setPreviewInner(isset($data['preview_inner']) ? 1 : 0); |
|
105 | } |
|
106 | ||
107 | public static function findCachedBySlug($slug) |
|
108 | { |
|
109 | $publication = self::findFirst(["slug = '$slug'", |
|
110 | 'cache' => [ |
|
111 | 'key' => self::cacheSlugKey($slug), |
|
112 | 'lifetime' => 60] |
|
113 | ]); |
|
114 | return $publication; |
|
115 | } |
|
116 | ||
117 | public static function cacheSlugKey($slug) |
|
118 | { |