Пример #1
0
 public function hydrate($data)
 {
     $currency = new Currency();
     $currency->setId((int) $data['__currency_id']);
     $currency->setName($data['__currency_name']);
     $currency->setFactor((double) $data['__currency_factor']);
     $currency->setCurrency($data['__currency_currency']);
     $currency->setSymbol($data['__currency_templatechar']);
     $currency->setSymbolPosition($data['__currency_symbol_position']);
     return $currency;
 }
Пример #2
0
 /**
  * Converts a currency doctrine model to a currency struct
  *
  * @param \Shopware\Models\Shop\Currency $currency
  * @return Struct\Currency
  */
 public function convertCurrency(Models\Shop\Currency $currency)
 {
     $struct = new Struct\Currency();
     $struct->setId($currency->getId());
     $struct->setName($currency->getName());
     $struct->setCurrency($currency->getCurrency());
     $struct->setFactor($currency->getFactor());
     $struct->setSymbol($currency->getSymbol());
     return $struct;
 }