Elcodi\Admin\CurrencyBundle\Controller\CurrencyController::masterCurrencyAction PHP Метод

masterCurrencyAction() публичный Метод

Set the master currency.
public masterCurrencyAction ( Elcodi\Component\Store\Entity\Interfaces\StoreInterface $store, Elcodi\Component\Currency\Entity\Interfaces\CurrencyInterface $currency ) : array
$store Elcodi\Component\Store\Entity\Interfaces\StoreInterface
$currency Elcodi\Component\Currency\Entity\Interfaces\CurrencyInterface
Результат array
    public function masterCurrencyAction(StoreInterface $store, CurrencyInterface $currency)
    {
        $translator = $this->get('translator');
        if (!$currency->isEnabled()) {
            throw new HttpException('403', $translator->trans('admin.currency.error.setting_disabled_master_currency'));
        }
        $store->setDefaultCurrency($currency);
        $this->get('elcodi.object_manager.store')->flush($store);
        return ['message' => $translator->trans('admin.currency.saved.master')];
    }