function ejecutar() { foreach ($this->sql as $sentencia) { try { $this->db->ejecutar($sentencia); } catch (toba_error $e) { throw new toba_error("Error cargando los datos de la personalizacion. El sql ejecutado fue: {$sentencia}"); } } }
private function kill_schemas($nombre) { $nombre_t = $nombre . '_logs'; $this->db->ejecutar("DROP SCHEMA IF EXISTS {$nombre_t} CASCADE;"); //Si existe schema previo de personalizacion lo borramos. $this->db->ejecutar("DROP SCHEMA IF EXISTS {$nombre} CASCADE;"); }
function migrar_estructura_campos_toba_2_4() { foreach ($this->tablas as $t) { $nombre = $this->prefijo . $t; if ($this->conexion->existe_tabla($this->schema_logs, $nombre)) { $sql = "ALTER TABLE {$this->schema_logs}.{$nombre} ALTER auditoria_usuario TYPE character varying(60);"; $this->conexion->ejecutar($sql); } } }
function elegir_camino_accion($usuario_elige_seguir) { if (!$usuario_elige_seguir) { if ($this->ejecuta_en_transaccion_global()) { //Si se esta ejecutando en una transaccion global se maneja afuera throw new toba_error_usuario('No se continua con el procedimiento, la importación falló. Se revertirán todos los cambios.'); } else { $this->db->abortar_transaccion(); //Si se usa transaccion local aborto aca. } } }
protected function check_constraints() { $this->db->agregar_savepoint('chequeo_conflicto'); $sql = $this->to_sql(); $fallo = false; try { $this->db->ejecutar($sql); $this->db->liberar_savepoint('chequeo_conflicto'); } catch (toba_error_db $e) { $fallo = $e; $this->db->abortar_savepoint('chequeo_conflicto'); } return $fallo; }
protected function alta(toba_punto_montaje $punto) { // primero se intenta impactar la base, si pasa de este punto se // escriben los archivos correspondientes $registro = toba_pm_a_registro::insert($punto, $this->db); $registro->grabar(); //Se actualiza el registro con el serial asignado $punto->set_id($this->db->recuperar_secuencia("apex_puntos_montaje_seq")); if ($punto->es_de_proyecto()) { if (!$punto->es_interno()) { $this->proyecto->agregar_dependencia($punto->get_proyecto_referenciado()); } } else { $this->actualizar_punto_indefinido($punto); } }