NAME

DBIx::Class::InflateColumn::TimePiece - Auto-create Time::Piece objects from integer (number of seconds since epoch) columns

VERSION

version 0.03

SYNOPSIS

package Event;

use base 'DBIx::Class::Core';

__PACKAGE__->load_components(qw/InflateColumn::TimePiece/);
__PACKAGE__->table('my_events');
__PACKAGE__->add_columns(
    event_name => {
        data_type => 'varchar',
        size      => 45,
    },
    event_created => {
        data_type          => 'integer',
        inflate_time_piece => 1,
    },
);

1;

In the above example, a DBIx::Class named Event is created, then this DBIx::Class Component is loaded and two columns are added to the my_events table.

A column with data_type equal to integer or int and with property inflate_time_piece set to true, will be inflated using localtime in Time::Piece and deflated using the epoch method.

SEE ALSO

DBIx::Class::InflateColumn::DateTime

AUTHOR

Renee Baecker <reneeb@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Renee Baecker.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)