lib/MojoMojo/Schema/Result/Tag.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 93.5% 29 / 31 CC 2 SCAR 3.5
CC
2
Cov
92%
refcount
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« lib/MojoMojo/Extensions/Counter.pm ↑ Summary lib/MojoMojo/Formatter/Comment.pm »
1 package MojoMojo::Schema::Result::Tag;
2  
3 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 40 ▶use parent qw/MojoMojo::Schema::Base::Result/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 40 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 __PACKAGE__->load_components( "Core" );
10 40 __PACKAGE__->table("tag");
11 40 __PACKAGE__->add_columns(
12 "id",
13 { data_type => "INTEGER", is_nullable => 0, size => undef, is_auto_increment => 1 },
14 "person",
15 { data_type => "INTEGER", is_nullable => 0, size => undef },
16 "page",
17 { data_type => "INTEGER", is_nullable => 1, size => undef },
18 "photo",
19 { data_type => "INTEGER", is_nullable => 1, size => undef },
20 "tag",
21 { data_type => "VARCHAR", is_nullable => 0, size => 100 },
22 );
23 40 __PACKAGE__->set_primary_key("id");
24 40 __PACKAGE__->belongs_to( "person", "MojoMojo::Schema::Result::Person", { id => "person" } );
25 40 __PACKAGE__->belongs_to( "page", "MojoMojo::Schema::Result::Page", { id => "page" } );
26 40 __PACKAGE__->belongs_to( "photo", "MojoMojo::Schema::Result::Photo", { id => "photo" } );
27  
28 =head1 NAME
29  
30 MojoMojo::Schema::Result::Tag - store page tags
31  
32 =head1 METHODS
33  
34 =head2 refcount
35  
36 Convenience method to return get_column('refcount') if this column
37 is available.
38  
39 =cut
40  
41 30 ▶sub refcount {
Subroutine refcount: called CC=2 SCAR=8.1
Pod documented
42 30 my $self = shift;
43 30 ▶ return $self->get_column('refcount') if $self->has_column_loaded('refcount');
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_column_loaded("refcount") 30 0 30
44 0 croak 'Tried to call refcount on resultset without column';
45 }
46  
47 =head1 AUTHOR
48  
49 Marcus Ramberg <mramberg@cpan.org>
50  
51 =head1 LICENSE
52  
53 This library is free software. You can redistribute it and/or modify
54 it under the same terms as Perl itself.
55  
56 =cut
57  
58 40 1;
« lib/MojoMojo/Extensions/Counter.pm ↑ Summary lib/MojoMojo/Formatter/Comment.pm »