コード例 #1
0
ファイル: RegistroMP.php プロジェクト: neeph/NoTengoNiUno
 public function save(Application_Model_Registro $model) {
     $data = array(
         'ID_TIPO_REGISTRO' =>$model->getIdTipoRegistro(),
         'ID_CATEGORIA' => $model->getIdCategoria(),
         'ID_PROYECTO' => $model->getIdProyecto(),
         'MONTO_REGISTRO' => $model->getMontoRegistro(),
         'FECHA_REGISTRO' => $model->getFechaRegistro(),
         'DESC_REGISTRO' => $model->getDescRegistro(),
         'ID_USUARIO' => $model->getIdUsuario()
     );
     if ('' === ($id = $model->getIdRegistro())) {
         $data['ID_REGISTRO'] = null;
         return $this->getDbTable()->insert($data);
     } else {
         return $this->getDbTable()->update($data, array('ID_REGISTRO = ?' => $id));
     }
 }