File Coverage
blib/lib/DBIx/Class/Schema/Loader/Column.pm |
|
Criterion |
Covered |
Total |
% |
statement |
32 |
32 |
100.0
|
branch |
1 |
2 |
50.0
|
condition |
|
|
n/a
|
subroutine |
11 |
11 |
100.0
|
pod |
1 |
1 |
100.0
|
total |
45 |
46 |
97.8
|
line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::Schema::Loader::Column; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
142
|
use strict; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
561
|
|
4
|
18
|
|
|
18
|
|
131
|
use warnings; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
498
|
|
5
|
18
|
|
|
18
|
|
95
|
use base 'Class::Accessor::Grouped'; |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
2141
|
|
6
|
18
|
|
|
18
|
|
140
|
use mro 'c3'; |
|
18
|
|
|
|
|
48
|
|
|
18
|
|
|
|
|
203
|
|
7
|
18
|
|
|
18
|
|
667
|
use Carp::Clan qw/^DBIx::Class/; |
|
18
|
|
|
|
|
61
|
|
|
18
|
|
|
|
|
177
|
|
8
|
18
|
|
|
18
|
|
2312
|
use Scalar::Util 'weaken'; |
|
18
|
|
|
|
|
63
|
|
|
18
|
|
|
|
|
953
|
|
9
|
18
|
|
|
18
|
|
147
|
use namespace::clean; |
|
18
|
|
|
|
|
56
|
|
|
18
|
|
|
|
|
146
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
DBIx::Class::Schema::Loader::Column - Class for Columns in |
14
|
|
|
|
|
|
|
L |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Used for representing columns in |
19
|
|
|
|
|
|
|
L. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Stringifies to L, and arrayrefifies to the |
22
|
|
|
|
|
|
|
L of |
23
|
|
|
|
|
|
|
L |
plus L.
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__PACKAGE__->mk_group_accessors(simple => qw/ |
28
|
|
|
|
|
|
|
table |
29
|
|
|
|
|
|
|
name |
30
|
|
|
|
|
|
|
/); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use overload |
33
|
12001
|
|
|
12001
|
|
67718
|
'""' => sub { $_[0]->name }, |
34
|
999
|
|
|
999
|
|
1835
|
'@{}' => sub { [ @{$_[0]->table->name_parts}, $_[0]->name ] }, |
|
999
|
|
|
|
|
4860
|
|
35
|
18
|
|
|
18
|
|
7109
|
fallback => 1; |
|
18
|
|
|
|
|
51
|
|
|
18
|
|
|
|
|
285
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 new |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The constructor. Takes L and L key-value parameters. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub new { |
46
|
2201
|
|
|
2201
|
1
|
4893
|
my $class = shift; |
47
|
|
|
|
|
|
|
|
48
|
2201
|
|
|
|
|
6509
|
my $self = { @_ }; |
49
|
2201
|
50
|
|
|
|
8043
|
croak "table is required" unless ref $self->{table}; |
50
|
|
|
|
|
|
|
|
51
|
2201
|
|
|
|
|
8790
|
weaken $self->{table}; |
52
|
|
|
|
|
|
|
|
53
|
2201
|
|
|
|
|
6703
|
return bless $self, $class; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 table |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
The L object this column belongs to. |
59
|
|
|
|
|
|
|
Required parameter for L |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 name |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The name of the column. Required parameter for L. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |