line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fey::Hash::ColumnsKey; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
45
|
use strict; |
|
10
|
|
|
|
|
63
|
|
|
10
|
|
|
|
|
335
|
|
4
|
10
|
|
|
10
|
|
49
|
use warnings; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
2329
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.47'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
return bless {}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub get { |
15
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $key_cols = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $key = join "\0", map { $_->name() } @{$key_cols}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return $self->{$key}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub store { |
24
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
25
|
0
|
|
|
|
|
|
my $key_cols = shift; |
26
|
0
|
|
|
|
|
|
my $sql = shift; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $key = join "\0", map { $_->name() } @{$key_cols}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self->{$key} = $sql; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# ABSTRACT: A hash where the keys are sets of Fey::Column objects |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Fey::Hash::ColumnsKey - A hash where the keys are sets of Fey::Column objects |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
version 0.47 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $hash = Fey::Hash::ColumnsKey->new(); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$hash->store( [ $col1, $col2 ] => $sql ); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This class is a helper for L<Fey::Meta::Class::Table>. It is used to |
58
|
|
|
|
|
|
|
cache SQL statements with a set of columns as the key. You should |
59
|
|
|
|
|
|
|
never need to use it directly. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2011 - 2015 by Dave Rolsky. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
70
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |