コード例 #1
0
ファイル: PageService.php プロジェクト: agitation/page-bundle
 public function __construct(Cache $cache, UrlService $urlService, LocaleService $localeService, LocaleConfigService $localeConfigService, $cacheKey, UserService $userService = null)
 {
     $this->pages = $cache->fetch($cacheKey) ?: [];
     $this->urlService = $urlService;
     $this->currentLocale = $localeService->getLocale();
     $this->availableLocales = $localeService->getAvailableLocales();
     $this->activeLocales = $localeConfigService->getActiveLocales();
     $this->primaryLocale = reset($this->activeLocales);
     $this->userService = $userService;
 }
コード例 #2
0
 public function __construct(Cache $cache, Kernel $kernel, FileCollector $fileCollector, LocaleService $localeService, Twig_Environment $twig, $cacheKey)
 {
     $this->cache = $cache;
     $this->kernel = $kernel;
     $this->fileCollector = $fileCollector;
     $this->localeService = $localeService;
     $this->twig = $twig;
     $this->cacheKey = $cacheKey;
     $this->defaultLocale = $localeService->getDefaultLocale();
     $this->availableLocales = $localeService->getAvailableLocales();
 }