defin currency at runtime

This commit is contained in:
Manuel Raynaud
2013-09-09 21:00:28 +02:00
parent f7abcf8756
commit bf46a937c0
4 changed files with 54 additions and 15 deletions

View File

@@ -13,6 +13,17 @@ class Currency extends BaseCurrency {
use \Thelia\Model\Tools\PositionManagementTrait;
public static function getDefaultCurrency()
{
$currency = CurrencyQuery::create()->findOneByByDefault(1);
if (null === $currency) {
throw new \RuntimeException("No default currency is defined. Please define one.");
}
return $currency;
}
/**
* {@inheritDoc}
*/