X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FInflateColumn.pm;h=d9817feb7ae167df1880328f3eb5cf88b0fa9467;hb=698c0549262dd7febffe1b16266816e1e374f1bb;hp=98b3c3879bb80966e87c5456eefd1400a97357c4;hpb=bc0c980086ba429cf33b1d471d1035601727231f;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index 98b3c38..d9817fe 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -6,7 +6,7 @@ use warnings; use base qw/DBIx::Class::Row/; -=head1 NAME +=head1 NAME DBIx::Class::InflateColumn - Automatically create objects from column data @@ -25,13 +25,13 @@ the column data. It also "deflates" objects into an appropriate format for the database. It can be used, for example, to automatically convert to and from -L objects for your date and time fields. +L objects for your date and time fields. =head1 METHODS =head2 inflate_column -Instruct L to inflate the given column. +Instruct L to inflate the given column. In addition to the column name, you must provide C and C methods. The C method is called when you access @@ -50,6 +50,11 @@ corresponding table class using something like: (Replace L with the appropriate module for your database, or consider L.) +The coderefs you set for inflate and deflate are called with two parameters, +the first is the value of the column to be inflated/deflated, the second is the +row object itself. Thus you can call C<< ->result_source->schema->storage->dbh >> on +it, to feed to L. + In this example, calls to an event's C accessor return a L object. This L object is later "deflated" when used in the database layer.