/usr/share/perl5/HTML/FormHandler/Model/DBIC/TypeMap.pm is in libhtml-formhandler-model-dbic-perl 0.29-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | package HTML::FormHandler::Model::DBIC::TypeMap;
# ABSTRACT: type mape for DBICFields
use Moose;
use namespace::autoclean;
has 'data_type_map' => ( is => 'ro', isa => 'HashRef',
lazy => 1, builder => 'build_data_type_map',
traits => ['Hash'],
handles => {
get_field_type => 'get'
},
);
sub build_data_type_map {
my $self = shift;
return {
'varchar' => 'Text',
'text' => 'TextArea',
'integer' => 'Integer',
'int' => 'Integer',
'numeric' => 'Integer',
'datetime' => 'DateTime',
'timestamp' => 'DateTime',
'bool' => 'Boolean',
'decimal' => 'Float',
'bigint' => 'Integer',
'enum' => 'Select',
};
}
sub type_for_column {
my ( $self, $info ) = @_;
my %field_def;
my $type;
if( my $def = $info->{extra}->{field_def} ) {
return $def;
}
if( $info->{data_type} ) {
$type = $self->get_field_type( lc($info->{data_type}) );
}
$type ||= 'Text';
$field_def{type} = $type;
$field_def{size} = $info->{size}
if( $type eq 'Textarea' && $info->{size} );
$field_def{required} = 1 if not $info->{is_nullable};
return \%field_def;
}
# stub
sub type_for_rel {
my ( $self, $rel ) = @_;
return;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
HTML::FormHandler::Model::DBIC::TypeMap - type mape for DBICFields
=head1 VERSION
version 0.29
=head1 SYNOPSIS
Use by L<HTML::FormHandler::TraitFor::DBICFields>.
=head1 AUTHOR
FormHandler Contributors - see HTML::FormHandler
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Gerda Shank.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|