GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::Class::TimeStamp(3) User Contributed Perl Documentation DBIx::Class::TimeStamp(3)

DBIx::Class::TimeStamp - DBIx::Class extension to update and create date and time based fields

Works in conjunction with InflateColumn::DateTime to automatically set update and create date and time based fields in a table.

 package My::Schema;

 __PACKAGE__->load_components(qw( TimeStamp ... Core ));
 
 __PACKAGE__->add_columns(
    id => { data_type => 'integer' },
    t_created => { data_type => 'datetime', set_on_create => 1 },
    t_updated => { data_type => 'datetime',
        set_on_create => 1, set_on_update => 1 },
 );

Now, any update or create actions will update the specified columns with the current time, using the DateTime inflator.

This is effectively trigger emulation to get consistent behavior across databases that either implement them poorly or not at all.

Returns a DateTime object pointing to now. Override this method if you have different time accounting functions, or want to do anything special.

The date and time objects in the database are expected to be inflated. As such you can be pretty flexible with what you want to return here.

J. Shirley <jshirley@gmail.com>

Florian Ragwitz (Porting to DBIx::Class::DynamicDefault)

LTJake/bricas

Copyright 2009 J. Shirley, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2010-09-05 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.