Commit 4b517d33 authored by Leo Gordon's avatar Leo Gordon
Browse files

now it should properly refresh data in the existing object

parent 7ab2d639
......@@ -124,15 +124,23 @@ sub fetch_by_statuses {
}
=head2 refresh
Arg [1] : Bio::EnsEMBL::Hive::AnalysisStats object
Description: reload the AnalysisStats object from the database
Returntype : Bio::EnsEMBL::Hive::AnalysisStats object - same one with reloaded data
=cut
sub refresh {
my ($self, $stats) = @_;
my ($self, $stats) = @_;
my $constraint = "ast.analysis_id = " . $stats->analysis_id;
my $new_stats = $self->fetch_by_analysis_id( $stats->analysis_id ); # fetch into a separate object
#return first element of _generic_fetch list
$stats = @{$self->_generic_fetch($constraint)};
%$stats = %$new_stats; # copy the data over
return $stats;
return $stats;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment