File: D:/HostingSpaces/SBogers85/equichecker.com/app/KommaApp/Core/Facades/Komma.php
<?php
/**
* Short description for the file.
*
* @author Tim Van Samang <timvansamang@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace KommaApp\Core\Facades;
use KommaApp\Countries\Models\Country;
use KommaApp\Languages\Models\Language;
use KommaApp\Sites\Models\Site;
class Komma
{
public static $site;
public static $language;
static function setSite(Site $site = null)
{
if (!$site) return false;
Self::$site = $site;
}
static function setLocale($lang)
{
if (is_int($lang)) $lang = Language::find($lang);
else if (is_string($lang)) $lang = Language::where('iso_2', '=', $lang)->first();
\App::setlocale($lang->iso_2);
Self::$language = $lang;
//Set the language based on the locale
}
static function setDefaultLocale()
{
self::setLocale(\Config::get('app.locale'));
}
static function getCountryIso($country_id){
if($country_id == null) return null;
if(!$country = Country::find($country_id)) return null;
return $country->iso_2;
}
}