Commit 08c0c4d3 authored by Leo Gordon's avatar Leo Gordon
Browse files

Inherited more classes from Storable even though they may not have dbID()

parent 9a1f8e72
......@@ -32,20 +32,20 @@
package Bio::EnsEMBL::Hive::Accumulator;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use Bio::EnsEMBL::Hive::Utils ('stringify');
use base ( 'Bio::EnsEMBL::Hive::Storable' ); # inherit dbID(), adaptor() and new() methods
sub new {
my $class = shift @_;
my $self = bless {}, $class;
my $self = $class->SUPER::new( @_ ); # deal with Storable stuff
my ($adaptor, $struct_name, $signature_template) =
rearrange([qw(adaptor struct_name signature_template) ], @_);
my ($struct_name, $signature_template) =
rearrange([qw(struct_name signature_template) ], @_);
$self->adaptor($adaptor) if(defined($adaptor));
$self->struct_name($struct_name) if(defined($struct_name));
$self->signature_template($signature_template) if(defined($signature_template));
......@@ -53,18 +53,6 @@ sub new {
}
sub adaptor {
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub struct_name {
my $self = shift @_;
......@@ -126,6 +114,5 @@ sub dataflow {
$self->adaptor->store( \@rows );
}
1;
......@@ -42,14 +42,15 @@
package Bio::EnsEMBL::Hive::AnalysisCtrlRule;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use Bio::EnsEMBL::Utils::Exception ('throw');
use Bio::EnsEMBL::Hive::URLFactory;
use Bio::EnsEMBL::Hive::Extensions;
use base ( 'Bio::EnsEMBL::Hive::Storable' ); # inherit dbID(), adaptor() and new() methods
=head2 new
Title : new
......@@ -62,14 +63,11 @@ use Bio::EnsEMBL::Hive::Extensions;
sub new {
my $class = shift @_;
my $self = bless {}, $class;
my ( $dbID, $adaptor, $condition_analysis_url, $ctrled_analysis_id ) =
rearrange( [ qw (DBID ADAPTOR CONDITION_ANALYSIS_URL CTRLED_ANALYSIS_ID) ], @_ );
# database persistence:
$self->dbID( $dbID ) if(defined($dbID));
$self->adaptor( $adaptor ) if(defined($adaptor));
my $self = $class->SUPER::new( @_ ); # deal with Storable stuff
my ( $condition_analysis_url, $ctrled_analysis_id ) =
rearrange( [ qw (CONDITION_ANALYSIS_URL CTRLED_ANALYSIS_ID) ], @_ );
# simple scalars:
$self->condition_analysis_url( $condition_analysis_url ) if(defined($condition_analysis_url));
......@@ -78,17 +76,6 @@ sub new {
return $self;
}
sub adaptor {
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
=head2 ctrled_analysis_id
......
......@@ -36,7 +36,6 @@
package Bio::EnsEMBL::Hive::AnalysisStats;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use Bio::EnsEMBL::Utils::Exception ('throw');
......
......@@ -32,19 +32,19 @@
package Bio::EnsEMBL::Hive::NakedTable;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use base ( 'Bio::EnsEMBL::Hive::Storable' ); # inherit dbID(), adaptor() and new() methods
sub new {
my $class = shift @_;
my $self = bless {}, $class;
my $self = $class->SUPER::new( @_ ); # deal with Storable stuff
my ($adaptor, $table_name, $insertion_method) =
rearrange([qw(adaptor table_name insertion_method) ], @_);
my ($table_name, $insertion_method) =
rearrange([qw(table_name insertion_method) ], @_);
$self->adaptor($adaptor) if(defined($adaptor));
$self->table_name($table_name) if(defined($table_name));
$self->insertion_method($insertion_method) if(defined($insertion_method));
......@@ -52,18 +52,6 @@ sub new {
}
sub adaptor {
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub table_name {
my $self = shift @_;
......@@ -73,6 +61,7 @@ sub table_name {
return $self->{'_table_name'};
}
sub insertion_method {
my $self = shift @_;
......@@ -82,6 +71,7 @@ sub insertion_method {
return $self->{'_insertion_method'} || 'INSERT_IGNORE';
}
sub url {
my $self = shift @_;
my $ref_dba = shift @_; # if reference dba is the same as 'our' dba, a shorter url can be generated
......@@ -94,6 +84,7 @@ sub url {
}
}
sub dataflow {
my ( $self, $output_ids, $emitting_job ) = @_;
......@@ -117,6 +108,5 @@ sub dataflow {
$adaptor->store( \@rows );
}
1;
......@@ -40,19 +40,19 @@
package Bio::EnsEMBL::Hive::ResourceDescription;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument ('rearrange');
use base ( 'Bio::EnsEMBL::Hive::Storable' ); # inherit dbID(), adaptor() and new() methods
sub new {
my $class = shift @_;
my $self = bless {}, $class;
my $self = $class->SUPER::new( @_ ); # deal with Storable stuff
my ($adaptor, $resource_class_id, $meadow_type, $submission_cmd_args, $worker_cmd_args) =
rearrange([qw(adaptor resource_class_id meadow_type submission_cmd_args worker_cmd_args) ], @_);
my ($resource_class_id, $meadow_type, $submission_cmd_args, $worker_cmd_args) =
rearrange([qw(resource_class_id meadow_type submission_cmd_args worker_cmd_args) ], @_);
$self->adaptor($adaptor) if(defined($adaptor));
$self->resource_class_id($resource_class_id);
$self->meadow_type($meadow_type);
$self->submission_cmd_args($submission_cmd_args);
......@@ -62,18 +62,6 @@ sub new {
}
sub adaptor {
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub resource_class_id {
my $self = shift @_;
......
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