@@ 93-101 (lines=9) @@ | ||
90 | $this->setPreviewInner(isset($data['preview_inner']) ? 1 : 0); |
|
91 | } |
|
92 | ||
93 | public static function findCachedBySlug($slug) |
|
94 | { |
|
95 | $publication = self::findFirst(["slug = '$slug'", |
|
96 | 'cache' => [ |
|
97 | 'key' => self::cacheSlugKey($slug), |
|
98 | 'lifetime' => 60] |
|
99 | ]); |
|
100 | return $publication; |
|
101 | } |
|
102 | ||
103 | public static function cacheSlugKey($slug) |
|
104 | { |
@@ 141-155 (lines=15) @@ | ||
138 | return $list; |
|
139 | } |
|
140 | ||
141 | public static function getCachedBySlug($slug) |
|
142 | { |
|
143 | $data = self::findFirst([ |
|
144 | 'slug = :slug:', |
|
145 | 'bind' => [ |
|
146 | 'slug' => $slug, |
|
147 | ], |
|
148 | 'cache' => [ |
|
149 | 'key' => self::cacheSlugKey($slug), |
|
150 | 'lifetime' => 86400, |
|
151 | ] |
|
152 | ]); |
|
153 | ||
154 | return $data; |
|
155 | } |
|
156 | ||
157 | public static function cacheSlugKey($slug) |
|
158 | { |