Sonata\Component\Currency\CurrencyManagerInterface::findOneByLabel PHP Method

findOneByLabel() public method

Finds the currency matching $currencyLabel.
public findOneByLabel ( string $currencyLabel ) : Sonata\Component\Currency\CurrencyInterface | null
$currencyLabel string
return Sonata\Component\Currency\CurrencyInterface | null
    public function findOneByLabel($currencyLabel);

Usage Example

Example #1
0
 /**
  * Constructs the currency detector service by finding the default currency
  *
  * @param string                   $currencyLabel
  * @param CurrencyManagerInterface $currencyManager
  */
 public function __construct($currencyLabel, CurrencyManagerInterface $currencyManager)
 {
     $this->currency = $currencyManager->findOneByLabel($currencyLabel);
 }
CurrencyManagerInterface