From: Aran Deltac Date: Mon, 27 Mar 2006 23:29:37 +0000 (+0000) Subject: New is_column_changed method in DBIC::Row. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=228dbcb430b9ed24cc2547cd88cbda8a747628b4;p=dbsrgits%2FDBIx-Class-Historic.git New is_column_changed method in DBIC::Row. --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index d71a13b..4a40e82 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -359,7 +359,8 @@ sub update_or_insert { =head2 is_changed - my @changed_col_names = $obj->is_changed + my @changed_col_names = $obj->is_changed(); + if ($obj->is_changed()) { ... } =cut @@ -367,6 +368,17 @@ sub is_changed { return keys %{shift->{_dirty_columns} || {}}; } +=head2 is_column_changed + + if ($obj->is_column_changed('col')) { ... } + +=cut + +sub is_column_changed { + my( $self, $col ) = @_; + return exists $self->{_dirty_columns}->{$col}; +} + =head2 result_source Accessor to the ResultSource this object was created from