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