X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRow.pm;h=eab11d9aa3081fde84fbede8291650c5cca7ef68;hp=ffe0359fcc5e9b0370d31ca01bf677d5874b9fc1;hb=b9b4e52f923e01eb496eb04a70e82824ecbe9dbe;hpb=456e850065d350d306858bcac1281682e18b33bb diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index ffe0359..eab11d9 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -785,6 +785,21 @@ sub register_column { $class->mk_group_accessors('column' => $acc); } +=head2 get_current_storage + +Returns a new Row which is whatever the Storage has for the currently created +Row object. You ca use this to see if the storage has become inconsistent with +whatever your Row object is. + +=cut + +sub get_current_storage { + my $self = shift @_; + my @primary_columns = map { $self->$_ } $self->primary_columns; + return $self->result_source->schema->txn_do(sub { + return $self->result_source->resultset->find(@primary_columns); + }); +} =head2 throw_exception