line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fey::Role::ColumnLike; |
2
|
|
|
|
|
|
|
|
3
|
27
|
|
|
27
|
|
926
|
use strict; |
|
27
|
|
|
|
|
39
|
|
|
27
|
|
|
|
|
899
|
|
4
|
27
|
|
|
27
|
|
110
|
use warnings; |
|
27
|
|
|
|
|
41
|
|
|
27
|
|
|
|
|
611
|
|
5
|
27
|
|
|
27
|
|
115
|
use namespace::autoclean; |
|
27
|
|
|
|
|
44
|
|
|
27
|
|
|
|
|
144
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.42'; |
8
|
|
|
|
|
|
|
|
9
|
27
|
|
|
27
|
|
1626
|
use Moose::Role; |
|
27
|
|
|
|
|
47
|
|
|
27
|
|
|
|
|
239
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# This seems weird, but basically we're saying that column-like things |
12
|
|
|
|
|
|
|
# do these four roles, but the implementation is different for |
13
|
|
|
|
|
|
|
# column-like things (than for example, selectable things). |
14
|
|
|
|
|
|
|
with( |
15
|
|
|
|
|
|
|
'Fey::Role::Selectable' => { -excludes => 'is_selectable' }, |
16
|
|
|
|
|
|
|
'Fey::Role::Comparable' => { -excludes => 'is_comparable' }, |
17
|
|
|
|
|
|
|
'Fey::Role::Groupable' => { -excludes => 'is_groupable' }, |
18
|
|
|
|
|
|
|
'Fey::Role::Orderable' => { -excludes => 'is_orderable' }, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
requires '_build_id', 'is_alias'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _containing_table_name_or_alias { |
24
|
212
|
|
|
212
|
|
4877
|
my $t = $_[0]->table(); |
25
|
|
|
|
|
|
|
|
26
|
212
|
100
|
|
|
|
827
|
$t->is_alias() ? $t->alias_name() : $t->name(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
28
|
100
|
|
28
|
1
|
675
|
sub is_selectable { return $_[0]->table() ? 1 : 0 } |
30
|
|
|
|
|
|
|
|
31
|
93
|
100
|
|
93
|
1
|
2848
|
sub is_comparable { return $_[0]->table() ? 1 : 0 } |
32
|
|
|
|
|
|
|
|
33
|
5
|
100
|
|
5
|
1
|
117
|
sub is_groupable { return $_[0]->table() ? 1 : 0 } |
34
|
|
|
|
|
|
|
|
35
|
18
|
100
|
|
18
|
1
|
422
|
sub is_orderable { return $_[0]->table() ? 1 : 0 } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# ABSTRACT: A role for "column-like" behavior |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Fey::Role::ColumnLike - A role for "column-like" behavior |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 0.42 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
use Moose 0.90; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
with 'Fey::Role::ColumnLike'; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Class which do this role are "column-like" . This role aggregates |
62
|
|
|
|
|
|
|
several other roles for the L<Fey::Column> and L<Fey::Column::Alias> |
63
|
|
|
|
|
|
|
classes. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 METHODS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This role provides the following methods: |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 $column->is_selectable() |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 $column->is_comparable() |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 $column->is_groupable() |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 $column->is_orderable() |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
These methods all return true when the C<< $column->table() >> |
78
|
|
|
|
|
|
|
returns an object. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 ROLES |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This class does the C<Fey::Role::Selectable>, |
83
|
|
|
|
|
|
|
C<Fey::Role::Comparable>, C<Fey::Role::Groupable>, and |
84
|
|
|
|
|
|
|
C<Fey::Role::Orderable> roles. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 BUGS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
See L<Fey> for details on how to report bugs. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 AUTHOR |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This software is Copyright (c) 2011 - 2015 by Dave Rolsky. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This is free software, licensed under: |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |