find() 공개 정적인 메소드

Find a specific currency
public static find ( string $code ) : mixed
$code string The three letter currency code
리턴 mixed A Currency object, or null if no currency was found
예제 #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;
 }
예제 #2
0
 public function testUnknownCurrencyReturnsNull()
 {
     $currency = Currency::find('XYZ');
     $this->assertNull($currency);
 }