![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-config/Model/Config/Backend/Currency/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * Config Directory currency backend model * Allows dispatching before and after events for each controller action */ namespace Magento\Config\Model\Config\Backend\Currency; /** * @api * @since 100.0.2 */ class DefaultCurrency extends AbstractCurrency { /** * Check default currency is available in installed currencies * Check default currency is available in allowed currencies * * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function afterSave() { if (!in_array($this->getValue(), $this->_getInstalledCurrencies())) { throw new \Magento\Framework\Exception\LocalizedException( __('Sorry, we haven\'t installed the default display currency you selected.') ); } if (!in_array($this->getValue(), $this->_getAllowedCurrencies())) { throw new \Magento\Framework\Exception\LocalizedException( __('Sorry, the default display currency you selected is not available in allowed currencies.') ); } return parent::afterSave(); } }