Changeset 13864 for lang/perl/Class-DBI-Plugin-AsFdat
- Timestamp:
- 06/14/08 14:17:06 (5 years ago)
- Location:
- lang/perl/Class-DBI-Plugin-AsFdat/trunk
- Files:
-
- 2 modified
-
Makefile.PL (modified) (1 diff)
-
lib/Class/DBI/Plugin/AsFdat.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Class-DBI-Plugin-AsFdat/trunk/Makefile.PL
r13861 r13864 6 6 requires 'Class::DBI' => '3.0.11'; 7 7 requires 'DateTime' => 0.2901; 8 requires 'Exporter' => 5.62; 8 9 9 10 test_requires 'Test::More'; -
lang/perl/Class-DBI-Plugin-AsFdat/trunk/lib/Class/DBI/Plugin/AsFdat.pm
r13859 r13864 3 3 use warnings; 4 4 our $VERSION = '0.02'; 5 use Exporter 'import'; 5 6 use Scalar::Util qw/blessed/; 6 7 7 sub import { 8 my $class = shift; 9 my $pkg = caller(0); 8 our @EXPORT = qw(as_fdat); 10 9 11 no strict 'refs'; 12 *{"$pkg\::as_fdat"} = sub { 13 my $self = shift; 10 sub as_fdat { 11 my $self = shift; 14 12 15 my $fdat;16 for my $column ($self->columns) {17 $fdat->{$column} = $self->get($column);13 my $fdat; 14 for my $column ($self->columns) { 15 $fdat->{$column} = $self->get($column); 18 16 19 # inflate the datetime 20 if (blessed $fdat->{$column} and $fdat->{$column}->isa('DateTime')) { 21 for my $type (qw(year month day hour minute second)) { 22 $fdat->{"${column}_$type"} = $fdat->{$column}->$type; 23 } 17 # inflate the datetime 18 if (blessed $fdat->{$column} and $fdat->{$column}->isa('DateTime')) { 19 for my $type (qw(year month day hour minute second)) { 20 $fdat->{"${column}_$type"} = $fdat->{$column}->$type; 24 21 } 25 22 } 26 return $fdat;27 };23 } 24 return $fdat; 28 25 } 29 26 … … 52 49 `fdat' is data for HTML::FillInForm. 53 50 51 =head1 METHODS 52 53 =over 4 54 55 =item as_fdat 56 57 transform cdbi row instance to hashref. 58 59 =back 60 54 61 =head1 AUTHOR 55 62
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)