/** * 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; }); }
/** * @return ICollection|Addon[] */ public function findByLastActivity() { return $this->addonRepository->findActive()->orderBy('this->github->pushedAt', 'DESC')->limitBy(3); }
/** * @return ICollection|Addon[] */ public function findNewest() { return $this->addonRepository->findActive()->orderBy('createdAt', 'DESC')->limitBy(5); }