X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FInflateColumn.pm;h=3cea9bb34c201e2923b82fbf9b6028bf42227e02;hb=7eb4ecc8fc02a8b99fbe8be59b03321dd773ab9a;hp=d9817feb7ae167df1880328f3eb5cf88b0fa9467;hpb=ec9c93f1b4e178dac5c594ff80932c867baa832e;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index d9817fe..3cea9bb 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -94,6 +94,17 @@ sub _deflated_column { return $deflate->($value, $self); } +=head2 get_inflated_column + + my $val = $obj->get_inflated_column($col); + +Fetch a column value in its inflated state. This is directly +analogous to L in that it only fetches a +column already retreived from the database, and then inflates it. +Throws an exception if the column requested is not an inflated column. + +=cut + sub get_inflated_column { my ($self, $col) = @_; $self->throw_exception("$col is not an inflated column") @@ -105,12 +116,31 @@ sub get_inflated_column { $self->_inflated_column($col, $self->get_column($col)); } +=head2 set_inflated_column + + my $copy = $obj->set_inflated_column($col => $val); + +Sets a column value from an inflated value. This is directly +analogous to L. + +=cut + sub set_inflated_column { my ($self, $col, @rest) = @_; my $ret = $self->_inflated_column_op('set', $col, @rest); return $ret; } +=head2 store_inflated_column + + my $copy = $obj->store_inflated_column($col => $val); + +Sets a column value from an inflated value without marking the column +as dirty. This is directly analogous to +L. + +=cut + sub store_inflated_column { my ($self, $col, @rest) = @_; my $ret = $self->_inflated_column_op('store', $col, @rest); @@ -133,6 +163,13 @@ sub _inflated_column_op { return $obj; } +=head2 update + +Updates a row in the same way as L, handling +inflation and deflation of columns appropriately. + +=cut + sub update { my ($class, $attrs, @rest) = @_; $attrs ||= {}; @@ -146,6 +183,13 @@ sub update { return $class->next::method($attrs, @rest); } +=head2 new + +Creates a row in the same way as L, handling +inflation and deflation of columns appropriately. + +=cut + sub new { my ($class, $attrs, @rest) = @_; $attrs ||= {};