예제 #1
0
 /**
  * Build cache
  */
 protected function build()
 {
     $this->cached = $this->cache->load('cached', function (&$dependencies) {
         $dependencies[Cache::EXPIRE] = new DateTime('+1 day');
         $cached = [];
         // Addons counts
         $cached['addons'] = $this->addonRepository->findActive()->countStored();
         return $cached;
     });
 }
예제 #2
0
 /**
  * @return ICollection|Addon[]
  */
 public function findByLastActivity()
 {
     return $this->addonRepository->findActive()->orderBy('this->github->pushedAt', 'DESC')->limitBy(3);
 }
예제 #3
0
 /**
  * @return ICollection|Addon[]
  */
 public function findNewest()
 {
     return $this->addonRepository->findActive()->orderBy('createdAt', 'DESC')->limitBy(5);
 }