Example #1
0
 /**
  * Constructor
  *
  * @param Site $siteRepo Rcm Site Repo
  */
 public function __construct(Site $siteRepo)
 {
     $list = [];
     /** @var \Rcm\Entity\Site $site */
     foreach ($siteRepo->getSites(true) as $site) {
         $list[$site->getLanguage()->getIso6391() . '_' . $site->getCountry()->getIso2()] = $site->getCountry()->getCountryName() . ' - ' . $site->getLanguage()->getLanguageName();
     }
     $this->locales = array_unique($list);
 }
Example #2
0
 /**
  * getSite
  *
  * @param string $domain
  * @param bool   $useCache
  *
  * @return mixed|null|Site
  */
 public function getSite($domain, $useCache = true)
 {
     $site = null;
     if ($useCache) {
         $site = $this->getCache($domain);
     }
     if (!empty($site)) {
         return $site;
     }
     $site = $this->siteRepo->getSiteByDomain($domain);
     if (empty($site)) {
         $site = new Site();
     }
     return $site;
 }