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;fp=lib%2FCatalyst%2FController%2FDBIC%2FAPI.pm;h=de143e68864f6b9bbe9bd2c7fe46ad0fcabc94ef;hp=03cb156713382ee730337d2bb6636c05d19f3db0;hb=71c17090d68f61e915d6c56c12b7d49e5dac4ca4;hpb=68e022911bf388167a3c92aa392e77dd46578cda diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index 03cb156..de143e6 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -954,6 +954,19 @@ sub get_errors return $c->stash->{_dbic_crud_errors}; } +=method_protected has_errors + +returns returns true if errors are stored in the stash + +=cut + +sub has_errors { + my ( $self, $c ) = @_; + die 'Catalyst app object missing' + unless defined $c; + return exists $c->stash->{_dbic_crud_errors}; +} + =head1 DESCRIPTION Easily provide common API endpoints based on your L schema classes. Module provides both RPC and REST interfaces to base functionality. Uses L and L to serialise response and/or deserialise request.