From: Florian Ragwitz Date: Tue, 16 Feb 2010 20:40:32 +0000 (+0100) Subject: Give row_format_output a context. X-Git-Tag: 2.002001~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=commitdiff_plain;h=4cb1523509973995e753ccb92db18642dc5ead13;hp=617efaa8a88cddd04c6ae42c14c4a483c78a329d Give row_format_output a context. --- diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index 3a5919e..3f33466 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -393,7 +393,7 @@ sub list_format_output foreach my $row ($rs->all) { - push(@$formatted, $self->row_format_output($row)); + push(@$formatted, $self->row_format_output($c, $row)); } $output->{$self->data_root} = $formatted; @@ -415,11 +415,15 @@ sub list_format_output =method_protected row_format_output -row_format_output is called each row of the inflated output generated from the search. It receives only one argument, the hashref that represents the row. By default, this method is merely a passthrough. +row_format_output is called each row of the inflated output generated from the search. It receives two arguments, the catalyst context and the hashref that represents the row. By default, this method is merely a passthrough. =cut -sub row_format_output { shift; shift; } # passthrough by default +sub row_format_output +{ + my ($self, $c, $row) = @_; + return $row; # passthrough by default +} =method_protected update_or_create