Esempio n. 1
0
 public static function detect($site)
 {
     return (string) (int) $site == $site ? Site::getById((int) $site) : Site::find($site);
 }
Esempio n. 2
0
 protected function mapCountries()
 {
     foreach (static::CountryMapping as $index => $expected) {
         if (!$this->{$expected}) {
             $site = Site::getById($this->{static::SiteMapping[$index]});
             if ($site instanceof Site) {
                 $this->{static::CountryMapping[$index]} = $site->countryId;
             }
         }
     }
 }