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

findOneByLabel() public method

public findOneByLabel ( $currencyLabel )
    public function findOneByLabel($currencyLabel)
    {
        $currency = new Currency();
        $currency->setLabel($currencyLabel);
        return $currency;
    }

Usage Example

Example #1
0
 public function testFindOneByLabel()
 {
     $registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
     $currencyManager = new CurrencyManager('Sonata\\Component\\Currency\\Currency', $registry);
     $this->assertEquals('EUR', $currencyManager->findOneByLabel('EUR')->getLabel());
 }
CurrencyManager