public function getSites() { if (!$this->sites) { $this->sites = $this->siteManager->findBy(array(), array('name' => 'ASC')); } if (!$this->siteAdmin->isGranted('LIST')) { $this->sites = array_values(array_filter($this->sites, function ($site) { return $this->authorizationChecker->isGranted('VIEW', $site); })); } return $this->sites; }
/** * @return SiteInterface[] */ public function getSites() { return $this->siteManager->findBy(array()); }
/** * @param Request $request * * @return SiteInterface[] */ protected function getSites(Request $request) { // sort by isDefault DESC in order to have default site in first position // which will be used if no site found for the current request return $this->siteManager->findBy(array('host' => array($request->getHost(), 'localhost'), 'enabled' => true), array('isDefault' => 'DESC')); }