Пример #1
0
 /**
  * @param $id
  * @return mixed
  */
 public function getSettings()
 {
     $key = md5(getLang() . $this->cacheKey . 'settings');
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $setting = $this->setting->getSettings();
     $this->cache->put($key, $setting);
     return $setting;
 }
Пример #2
0
 /**
  * @param $slug
  * @return mixed
  */
 public function getArticlesBySlug($slug)
 {
     $key = md5(getLang() . $this->cacheKey . '.all.tags.slug');
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $tags = $this->tag->getArticlesBySlug($slug);
     //$this->cache->put($key, $tags);
     return $tags;
 }
Пример #3
0
 /**
  * @return mixed
  */
 public function all()
 {
     $key = md5(getLang() . $this->cacheKey . 'all.sliders');
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $sliders = $this->slider->all();
     $this->cache->put($key, $sliders);
     return $sliders;
 }
Пример #4
0
 /**
  * @param int $page
  * @param int $limit
  * @param bool $all
  * @return mixed
  */
 public function paginate($page = 1, $limit = 10, $all = false)
 {
     $allkey = $all ? '.all' : '';
     $key = md5(getLang() . $this->cacheKey . '.page.' . $page . '.' . $limit . $allkey);
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $paginated = $this->page->paginate($page, $limit, $all);
     $this->cache->put($key, $paginated);
     return $paginated;
 }
Пример #5
0
 /**
  * @param $limit
  * @return mixed
  */
 public function getLastArticle($limit)
 {
     $key = md5(getLang() . $limit . $this->cacheKey . '.last');
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $articles = $this->article->getLastArticle($limit);
     $this->cache->put($key, $articles);
     return $articles;
 }
Пример #6
0
 /**
  * @param $limit
  * @return mixed
  */
 public function getLastNews($limit)
 {
     $key = md5(getLang() . $limit . $this->cacheKey . '.last');
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $news = $this->news->getLastNews($limit);
     $this->cache->put($key, $news);
     return $news;
 }
Пример #7
0
 /**
  * @param $id
  * @return bool|mixed
  */
 public function hasChildItems($id)
 {
     $key = md5(getLang() . $this->cacheKey . $id . '.has.child');
     if ($this->cache->has($key)) {
         return $this->cache->get($key);
     }
     $result = $this->menu->hasChildItems($id);
     $this->cache->put($key, $result);
     return $result;
 }