Object/Metadata/Relationship/OneToOne.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 66.6% 2 / 3 totaltotal 48.3% 15 / 31 CC 3 SCAR 17.7
CC
3
Cov
43%
requires_preexisting_parent_object
12.0
is_singular
2.0
BEGIN
1.0
CRAP 5.9
« Object/Metadata/Column/Array.pm ↑ Summary Object/Metadata/Column/Numeric.pm »
1 package Rose::DB::Object::Metadata::Relationship::OneToOne;
2  
3 61 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 61 ▶use Rose::DB::Object::Metadata::Relationship::ManyToOne;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 61 our @ISA = qw(Rose::DB::Object::Metadata::Relationship::ManyToOne);
7  
8 61 our $VERSION = '0.771';
9  
10 16 ▶sub type { 'one to one' }
Subroutine type: called CC=1 SCAR=0.0
Pod documented
11  
12 0 ▶sub is_singular { 1 }
Subroutine is_singular: not called CC=1 SCAR=6.9
Pod documented
13  
14 sub requires_preexisting_parent_object
15 0 ▶{
Subroutine requires_preexisting_parent_object: not called CC=3 SCAR=24.8
Pod undocumented
16 0 my($self) = shift;
17  
18 0 my $meta = $self->parent;
19 0 my $f_meta = $self->class->meta;
20  
21 0 my $column_map = $self->column_map;
22 0 my %pk = map { $_ => 1 } $meta->primary_key_column_names;
23  
24  
25 0 foreach my $local_column (keys %$column_map)
26 {
27 0 ▶ if($pk{$local_column})
Branch: 1 branch
BranchTrueFalseTotal
if ($pk{$local_column}) 0 0 0
28 {
29 0 return $self->{'requires_preexisting_parent_object'} = 1;
30 }
31 }
32  
33 0 return $self->{'requires_preexisting_parent_object'} = 0;
34 }
35  
36 61 1;
37  
38 __END__
« Object/Metadata/Column/Array.pm ↑ Summary Object/Metadata/Column/Numeric.pm »