Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DefaultCurrency.php
Go to the documentation of this file.
1 <?php
12 
18 {
26  public function afterSave()
27  {
28  if (!in_array($this->getValue(), $this->_getInstalledCurrencies())) {
29  throw new \Magento\Framework\Exception\LocalizedException(
30  __('Sorry, we haven\'t installed the default display currency you selected.')
31  );
32  }
33 
34  if (!in_array($this->getValue(), $this->_getAllowedCurrencies())) {
35  throw new \Magento\Framework\Exception\LocalizedException(
36  __('Sorry, the default display currency you selected is not available in allowed currencies.')
37  );
38  }
39 
40  return parent::afterSave();
41  }
42 }
__()
Definition: __.php:13