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