Esempio n. 1
0
 /**
  * Сохранить
  * 
  * @param \Application_Model_Currency $currency Модель currency
  */
 public function save(Application_Model_Currency $currency)
 {
     $data = ['title' => $currency->getTitle(), 'name' => $currency->getName(), 'providerCurrencyId' => $currency->getProviderCurrencyId()];
     if (null === ($id = $currency->getId())) {
         unset($data['id']);
         $this->getDbTable()->insert($data);
     } else {
         $this->getDbTable()->update($data, ['id = ?' => $id]);
     }
 }