Пример #1
0
 /**
  * @param string $etiqueta
  * @return toba_punto_montaje
  */
 protected function get($etiqueta)
 {
     // idem anterior
     $etiqueta = $this->db->quote($etiqueta);
     $proyecto = $this->db->quote($this->proyecto->get_id());
     $sql = "SELECT * FROM apex_puntos_montaje WHERE etiqueta={$etiqueta} AND proyecto={$proyecto}";
     $registro = $this->db->consultar_fila($sql);
     if (empty($registro)) {
         throw new toba_error("PUNTOS MONTAJE: El punto de montaje con etiqueta {$etiqueta} no existe");
     } else {
         return toba_punto_montaje_factory::construir($registro);
     }
 }
 function purgar_datos($tabla, $lapso_tiempo)
 {
     $tiempo = $this->conexion->quote($lapso_tiempo . ' months');
     $sql = 'DELETE FROM ' . $this->schema_logs . ".{$tabla} WHERE auditoria_fecha::timestamp  < (now() - interval {$tiempo});";
     $this->conexion->ejecutar($sql);
 }