Example #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;
 }
Example #2
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;
 }
Example #3
0
 /**
  * @param null $page
  * @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->faq->paginate($page, $limit, $all);
     $this->cache->put($key, $paginated);
     return $paginated;
 }
Example #4
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;
 }
Example #5
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;
 }
Example #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;
 }