setSymbol example

use Shopware\Bundle\StoreFrontBundle\Struct\Currency;

class CurrencyHydrator extends Hydrator
{
    public function hydrate($data)
    {
        $currency = new Currency();
        $currency->setId((int) $data['__currency_id']);
        $currency->setName($data['__currency_name']);
        $currency->setFactor((float) $data['__currency_factor']);
        $currency->setCurrency($data['__currency_currency']);
        $currency->setSymbol($data['__currency_templatechar']);
        $currency->setSymbolPosition($data['__currency_symbol_position']);

        return $currency;
    }
}
/** * @return Currency */
    public static function createFromCurrencyEntity(CurrencyEntity $currency)
    {
        $struct = new self();

        $struct->setId($currency->getId());
        $struct->setName($currency->getName());
        $struct->setCurrency($currency->getCurrency());
        $struct->setFactor($currency->getFactor());
        $struct->setSymbol($currency->getSymbol());

        return $struct;
    }

    /** * @param int $id */
    public function setId($id)
    {
        $this->id = $id;
    }

    
Home | Imprint | This part of the site doesn't use cookies.