From f844f1e26b05d90fbaec71b0e9cc016221a5f4b9 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 6 Aug 2013 15:54:44 +0200 Subject: [PATCH] LXDebug::dump_object zum Dumpen von den Spalten von RDBO-Instanzen Dumpt keine Datenbankhandle, keine Relationships --- SL/LXDebug.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) = @_; -- 2.20.1