X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FInflateColumn%2FDateTime.pm;h=bb6223d69737623debedc8411e80832e05414ad2;hb=e50536940adf2ebaef907a0c29ae37fbd5ce95b1;hp=0ceb679002cda51de5105cbe3062ccfea2c4668c;hpb=24f5cbcb3f001980062d17f8e4fc6fb4f10a9878;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/InflateColumn/DateTime.pm b/lib/DBIx/Class/InflateColumn/DateTime.pm index 0ceb679..bb6223d 100644 --- a/lib/DBIx/Class/InflateColumn/DateTime.pm +++ b/lib/DBIx/Class/InflateColumn/DateTime.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base qw/DBIx::Class/; use DBIx::Class::Carp; +use DBIx::Class::_Util 'dbic_internal_try'; use Try::Tiny; use namespace::clean; @@ -78,8 +79,8 @@ deflation/inflation as defined in the storage class. For instance, for a C field the methods C and C would be called on deflation/inflation. If the storage class does not provide a specialized inflator/deflator, C<[parse|format]_datetime> will -be used as a fallback. See L for more information on -date formatting. +be used as a fallback. See L +for more information on date formatting. For more help with using components, see L. @@ -197,11 +198,11 @@ sub _flate_or_fallback my $preferred_method = sprintf($method_fmt, $info->{ _ic_dt_method }); my $method = $parser->can($preferred_method) || sprintf($method_fmt, 'datetime'); - return try { + return dbic_internal_try { $parser->$method($value); } catch { - $self->throw_exception ("Error while inflating ${value} for $info->{__dbic_colname} on ${self}: $_") + $self->throw_exception ("Error while inflating '$value' for $info->{__dbic_colname} on ${self}: $_") unless $info->{datetime_undef_if_invalid}; undef; # rv }; @@ -218,7 +219,7 @@ sub _deflate_from_datetime { } sub _datetime_parser { - shift->result_source->storage->datetime_parser (@_); + shift->result_source->schema->storage->datetime_parser (@_); } sub _post_inflate_datetime { @@ -305,20 +306,18 @@ use the old way you'll see a warning - please fix your code then! can be found in the documentation for L. =item Further discussion of problems inherent to the Floating timezone: - L + L and L<< $dt->set_time_zone|DateTime/"Set" Methods >> =back -=head1 AUTHOR +=head1 FURTHER QUESTIONS? -Matt S. Trout +Check the list of L. -=head1 CONTRIBUTORS - -Aran Deltac - -=head1 LICENSE - -You may distribute this code under the same terms as Perl itself. +=head1 COPYRIGHT AND LICENSE +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L.