X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FColumnsAsHash.pm;h=fa572d683205eb652685efad4c6871dfd35bed9d;hb=5d2588ccdd92a01535fefd77c45240f75e8ec090;hp=b5f1168eae72318535f91718037422df90ff758a;hpb=1c779eb2212fac3c44e615418c2b516e18cbc5e2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat/ColumnsAsHash.pm b/lib/DBIx/Class/CDBICompat/ColumnsAsHash.pm index b5f1168..fa572d6 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnsAsHash.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnsAsHash.pm @@ -7,17 +7,17 @@ use warnings; =head1 NAME -DBIx::Class::CDBICompat::ColumnsAsHash +DBIx::Class::CDBICompat::ColumnsAsHash - Emulates the behavior of Class::DBI where the object can be accessed as a hash of columns. =head1 SYNOPSIS -See DBIx::Class::CDBICompat for directions for use. +See DBIx::Class::CDBICompat for usage directions. =head1 DESCRIPTION Emulates the I behavior of Class::DBI where the object can be accessed as a hash of columns. This is often used as a performance hack. - my $column = $row->{column}; + my $column = $result->{column}; =head2 Differences from Class::DBI @@ -39,16 +39,16 @@ sub inflate_result { my $class = shift; my $new = $class->next::method(@_); - + $new->_make_columns_as_hash; - + return $new; } sub _make_columns_as_hash { my $self = shift; - + for my $col ($self->columns) { if( exists $self->{$col} ) { warn "Skipping mapping $col to a hash key because it exists";