9 $dataflow_rule_adaptor = $db_adaptor->get_DataflowRuleAdaptor;
10 $dataflow_rule_adaptor = $dataflowRuleObj->adaptor;
14 Module to encapsulate all db access
for persistent
class DataflowRule.
15 There should be just one per application and database connection.
19 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
20 Copyright [2016-2024] EMBL-European Bioinformatics Institute
22 Licensed under the Apache License,
Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
23 You may obtain a copy of the License at
27 Unless required by applicable law or agreed to in writing, software distributed under the License
28 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 See the License
for the specific language governing permissions and limitations under the License.
33 Please subscribe to the
Hive mailing list: http:
38 package Bio::EnsEMBL::Hive::DBSQL::DataflowRuleAdaptor;
44 use base (
'Bio::EnsEMBL::Hive::DBSQL::ObjectAdaptor');
47 sub check_object_present_in_db_by_content {
52 sub default_table_name {
53 return 'dataflow_rule';
58 return 'Bio::EnsEMBL::Hive::DataflowRule';
62 =head2 branch_name_2_code
64 Description: encodes a branch mnemonic name into numeric code
68 sub branch_name_2_code {
70 shift @_
if(ref($_[0])); # skip the first argument
if it is an object, so it works both as a method and a subroutine
72 my ($branch_name_or_code, $no_default) = @_;
74 return ($no_default ? undef : 1) unless(defined($branch_name_or_code));
76 my $branch_code = ($branch_name_or_code=~/^\-?\d+$/)
77 ? $branch_name_or_code
84 }->{$branch_name_or_code};
85 return defined($branch_code) ? $branch_code : die
"Could not map the branch_name '$branch_name_or_code' to the internal code";