From: Marcus Ramberg Date: Wed, 8 Mar 2006 11:58:31 +0000 (+0000) Subject: added has_column_loaded X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=def81720ba4d78afebcfd164cd977af555297d23;p=dbsrgits%2FDBIx-Class-Historic.git added has_column_loaded --- diff --git a/Changes b/Changes index 6549a9f..313caad 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for DBIx::Class + - Added has_column_loaded to Row - Storage::DBI connect_info supports coderef returning dbh as 1st arg - add_components() doesn't prepend base when comp. prefixed with + - $schema->deploy diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 2466753..28cd906 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -171,6 +171,14 @@ sub get_column { return undef; } +sub has_column_loaded { + my ($self, $column) = @_; + $self->throw_exception( "Can't call has_column data as class method" ) unless ref $self; + return 1 + if exists $self->{_column_data}{$column}; + return 0; +} + =head2 get_columns my %data = $obj->get_columns;