getCommentCache() public method

Returns the cache container for blog comments:
public getCommentCache ( ) : CacheInterface
return CacheInterface
Esempio n. 1
0
 /**
  * @route ajax/blog_load_comments
  */
 public function loadComments()
 {
     if (IDE_HACKS) {
         $this->blog = new Blog();
     }
     $cache = $this->blog->getCommentCache();
     $blog = (string) ($_POST['blogpost'] ?? '');
     if (empty($blog)) {
         \Airship\json_response(['status' => 'error', 'message' => 'No blogpost ID provided']);
     }
     $cachedComments = $cache->get($blog);
     if ($cachedComments) {
         \Airship\json_response($cachedComments);
     }
     $this->fetchComments($cache, $blog);
 }