find() public static method

Find a specific currency
public static find ( string $code ) : mixed
$code string The three letter currency code
return mixed A Currency object, or null if no currency was found
Ejemplo n.º 1
0
 /**
  * Get the number of decimal places in the payment currency.
  *
  * @return integer
  */
 public function getCurrencyDecimalPlaces()
 {
     if ($currency = Currency::find($this->getCurrency())) {
         return $currency->getDecimals();
     }
     return 2;
 }
Ejemplo n.º 2
0
 public function testUnknownCurrencyReturnsNull()
 {
     $currency = Currency::find('XYZ');
     $this->assertNull($currency);
 }