Skip to content
Snippets Groups Projects
Commit 4da57a10 authored by Leo Gordon's avatar Leo Gordon
Browse files

weaken the link back from the object back to the adaptor

parent 595d9e36
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,8 @@
package Bio::EnsEMBL::Hive::AnalysisCtrlRule;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Hive::URLFactory;
use Bio::EnsEMBL::Hive::Extensions;
use Bio::EnsEMBL::Utils::Argument;
......@@ -76,9 +78,14 @@ sub new {
}
sub adaptor {
my ( $self, $adaptor ) = @_;
$self->{'_adaptor'} = $adaptor if defined $adaptor;
return $self->{'_adaptor'};
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
......
......@@ -27,6 +27,8 @@
package Bio::EnsEMBL::Hive::AnalysisJob;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument; # import 'rearrange()'
use Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor;
use Bio::EnsEMBL::Hive::DBSQL::DataflowRuleAdaptor;
......@@ -58,11 +60,17 @@ sub new {
}
sub adaptor {
my $self = shift;
$self->{'_adaptor'} = shift if(@_);
return $self->{'_adaptor'};
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub dbID {
my $self = shift;
$self->{'_dbID'} = shift if(@_);
......
......@@ -26,6 +26,7 @@
package Bio::EnsEMBL::Hive::AnalysisStats;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Analysis;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
......@@ -44,12 +45,19 @@ sub new {
return $self;
}
sub adaptor {
my $self = shift;
$self->{'_adaptor'} = shift if(@_);
return $self->{'_adaptor'};
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub refresh {
my $self = shift;
......
......@@ -50,6 +50,8 @@
package Bio::EnsEMBL::Hive::DataflowRule;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument; # import 'rearrange()'
use Bio::EnsEMBL::Utils::Exception;
use Bio::EnsEMBL::Hive::DBSQL::AnalysisAdaptor;
......@@ -112,12 +114,15 @@ sub dbID {
sub adaptor {
my $self = shift @_;
if(@_) { # setter mode
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
=head2 branch_code
Function: getter/setter method for the branch_code of the dataflow rule
......
......@@ -20,6 +20,8 @@
package Bio::EnsEMBL::Hive::NakedTable;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument; # import 'rearrange()'
sub new {
......@@ -37,15 +39,19 @@ sub new {
return $self;
}
sub adaptor {
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub table_name {
my $self = shift @_;
......
......@@ -27,6 +27,8 @@
package Bio::EnsEMBL::Hive::ResourceDescription;
use strict;
use Scalar::Util ('weaken');
use Bio::EnsEMBL::Utils::Argument; # import 'rearrange()'
sub new {
......@@ -46,15 +48,19 @@ sub new {
return $self;
}
sub adaptor {
my $self = shift @_;
if(@_) {
$self->{'_adaptor'} = shift @_;
weaken $self->{'_adaptor'};
}
return $self->{'_adaptor'};
}
sub rc_id {
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