From: Moritz Bunkus Date: Tue, 6 Aug 2013 13:54:44 +0000 (+0200) Subject: LXDebug::dump_object zum Dumpen von den Spalten von RDBO-Instanzen X-Git-Tag: release-3.1.0beta1~96 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f844f1e26b05d90fbaec71b0e9cc016221a5f4b9;p=kivitendo-erp.git LXDebug::dump_object zum Dumpen von den Spalten von RDBO-Instanzen Dumpt keine Datenbankhandle, keine Relationships --- diff --git a/SL/LXDebug.pm b/SL/LXDebug.pm index 6517d9c4c..d32f458ad 100644 --- a/SL/LXDebug.pm +++ b/SL/LXDebug.pm @@ -213,6 +213,17 @@ sub dump_sql_result { $self->message($level, $prefix . sprintf('(%d row%s)', scalar @{ $results }, scalar @{ $results } > 1 ? 's' : '')); } +sub dump_object { + my ($self, $level, $text, $object) = @_; + + my $copy; + if ($object) { + $copy->{$_} = $object->$_ for $object->meta->columns; + } + + $self->dump($level, $text, $copy); +} + sub show_diff { my ($self, $level, $item1, $item2, %params) = @_;