X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=blobdiff_plain;f=lib%2FCatalyst%2FController%2FDBIC%2FAPI.pm;h=422dc540d1b0567861c7180dc949c2b03449cd0e;hp=e257ed1edc8d8ccf658539c2970a0aad2e46352e;hb=9a29ee35ad6dba84d7741dc1e115fe90583a5d88;hpb=967ca1825362f2ffbbda4c2cf3f1eaab27149bb3 diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index e257ed1..422dc54 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -173,6 +173,19 @@ sub deserialize :Chained('setup') :CaptureArgs(0) :PathPart('') :ActionClass('De $self->inflate_request($c, $req_params); } +=method_protected generate_rs + +generate_rs is used by inflate_request to generate the resultset stored in the current request. It receives $c as its only argument. And by default it merely returns the resultset from the stored_result_source on the controller. Override this method if you need to manipulate the default implementation of getting the resultset from the controller. + +=cut + +sub generate_rs +{ + my ($self, $c) = @_; + return $self->stored_result_source->resultset; +} + + =method_protected inflate_request inflate_request is called at the end of deserialize to populate key portions of the request with the useful bits @@ -192,7 +205,7 @@ sub inflate_request $c->req->_set_request_data($params); # set the current resultset - $c->req->_set_current_result_set($self->stored_result_source->resultset); + $c->req->_set_current_result_set($self->generate_rs($c)); } catch