| 1 | package Smolder::DB::TestFileComment; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use base 'Smolder::DB'; | ||
| 5 | |||
| 6 | __PACKAGE__->set_up_table('test_file_comment'); | ||
| 7 | |||
| 8 | __PACKAGE__->has_a(project => 'Smolder::DB::Project'); | ||
| 9 | __PACKAGE__->has_a(test_file => 'Smolder::DB::TestFile'); | ||
| 10 | __PACKAGE__->has_a(developer => 'Smolder::DB::Developer'); | ||
| 11 | __PACKAGE__->has_a( | ||
| 12 | added => 'DateTime', | ||
| 13 | inflate => sub { DateTime->from_epoch(epoch => shift, time_zone => 'local') }, | ||
| 14 | deflate => sub { shift->epoch }, | ||
| 15 | ); | ||
| 16 | |||
| 17 | # make sure added is set to NOW | ||
| 18 | __PACKAGE__->add_trigger( | ||
| 19 | before_create => sub { | ||
| 20 | my $self = shift; | ||
| 21 | $self->_attribute_set(added => DateTime->now(time_zone => 'local')); | ||
| 22 | }, | ||
| 23 | ); | ||
| 24 | |||
| 25 | =head1 NAME | ||
| 26 | |||
| 27 | Smolder::DB::TestFileComment | ||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | L<Class::DBI> based model class for the 'test_file_comment' table in the database. | ||
| 32 | |||
| 33 | =head1 METHODS | ||
| 34 | |||
| 35 | =head2 ACCESSSOR/MUTATORS | ||
| 36 | |||
| 37 | Each column in the borough table has a method with the same name that can be | ||
| 38 | used as an accessor and mutator. | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | 1; |