Worked on catalog

This commit is contained in:
Franck Allimant
2013-10-23 23:41:39 +02:00
parent ada32660fe
commit 0bd57b0a5a
46 changed files with 3483 additions and 3009 deletions

View File

@@ -3,7 +3,35 @@
namespace Thelia\Model;
use Thelia\Model\Base\Country as BaseCountry;
use Thelia\Core\Translation\Translator;
class Country extends BaseCountry {
/**
* Return the default country
*
* @throws LogicException if no default country is defined
*/
public static function getDefaultCountry() {
$dc = CountryQuery::create()->findOneByByDefault(true);
if ($dc == null)
throw new \LogicException(Translator::getInstance()->trans("Cannot find a default country. Please define one."));
return $dc;
}
/**
* Return the shop country
*
* @throws LogicException if no shop country is defined
*/
public static function getShopLocation() {
$dc = CountryQuery::create()->findOneByShopCountry(true);
if ($dc == null)
throw new \LogicException(Translator::getInstance()->trans("Cannot find the shop country. Please select a shop country."));
return $dc;
}
}