1package App::Netdisco::DB::ResultSet::DevicePortLog; 2use base 'App::Netdisco::DB::ResultSet'; 3 4use strict; 5use warnings; 6 7__PACKAGE__->load_components(qw/ 8 +App::Netdisco::DB::ExplicitLocking 9/); 10 11=head1 ADDITIONAL METHODS 12 13=head2 with_times 14 15This is a modifier for any C<search()> which will add the following additional 16synthesized column to the result set: 17 18=over 4 19 20=item creation_stamp 21 22=back 23 24=cut 25 26sub with_times { 27 my ($rs, $cond, $attrs) = @_; 28 29 return $rs 30 ->search_rs($cond, $attrs) 31 ->search({}, 32 { 33 '+columns' => { 34 creation_stamp => \"to_char(creation, 'YYYY-MM-DD HH24:MI:SS')", 35 }, 36 }); 37} 38 391; 40