| @@ 131-141 (lines=11) @@ | ||
| 128 | { |
|
| 129 | $this->getCountryCurrencyData(); |
|
| 130 | $CNT_ISO = $CNT_ISO !== null ? $CNT_ISO : $this->site_country_iso; |
|
| 131 | if(! isset($this->country_currencies_by_iso_code[ $CNT_ISO ])) { |
|
| 132 | throw new InvalidArgumentException( |
|
| 133 | sprintf( |
|
| 134 | esc_html__( |
|
| 135 | 'Valid country currency data could not be found for the "%1$s" country code;', |
|
| 136 | 'event_espresso' |
|
| 137 | ), |
|
| 138 | $CNT_ISO |
|
| 139 | ) |
|
| 140 | ); |
|
| 141 | } |
|
| 142 | return $this->createCurrencyFromCountryCurrency( |
|
| 143 | $this->country_currencies_by_iso_code[ $CNT_ISO ] |
|
| 144 | ); |
|
| @@ 165-175 (lines=11) @@ | ||
| 162 | public function createFromCode($code) |
|
| 163 | { |
|
| 164 | $this->getCountryCurrencyData(); |
|
| 165 | if (! isset($this->country_currencies_by_currency[ $code ])) { |
|
| 166 | throw new InvalidArgumentException( |
|
| 167 | sprintf( |
|
| 168 | esc_html__( |
|
| 169 | 'A valid currency could not be found for the "%1$s" currency code;', |
|
| 170 | 'event_espresso' |
|
| 171 | ), |
|
| 172 | $code |
|
| 173 | ) |
|
| 174 | ); |
|
| 175 | } |
|
| 176 | return $this->createCurrencyFromCountryCurrency( |
|
| 177 | $this->country_currencies_by_currency[ $code ] |
|
| 178 | ); |
|