Catalyst::Controller::CRUD - CRUD (create/read/update/delete) Controller for Catalyst


Catalyst-Plugin-CRUD documentation  | view source Contained in the Catalyst-Plugin-CRUD distribution.

Index


NAME

Top

Catalyst::Controller::CRUD - CRUD (create/read/update/delete) Controller for Catalyst

SYNOPSIS

Top

  package MyApp::Controller::Foo;

  use base qw(Catalyst::Controller);
  use Catalyst::Controller::CRUD::CDBI;

  sub create : Local {
    my ($self, $c) = @_;
    Catalyst::Controller::CRUD::CDBI->create($c, $self);
  }

  1;

DESCRIPTION

Top

This module provides CRUD (create/read/update/delete) action.

 create: insert new record
 read:   retrieve record
 update: update already record
 delete: delete record
 list:   retrieve all records

EXPORT

None by default.

METHODS

Top

create

Create action.

If there is $c->stash->{create}->{error}, then it does not insert new recoed.

Triggers:

 $self->call_trigger( 'create_check', $c, $hash );
 $self->call_trigger( 'create_after', $c, $model );

read

Read action.

update

Update action.

If there is $c->stash->{update}->{error}, then it does not update already recoed.

Triggers:

 $self->call_trigger( 'update_check', $c, $hash );
 $self->call_trigger( 'update_after', $c, $model );

delete

Delete action.

If there is $c->stash->{delete}->{error}, then it does not delete recoed.

Triggers:

 $self->call_trigger( 'delete_check', $c, $model );
 $self->call_trigger( 'delete_after', $c, $model );

list

List action.

INTERFACE METHODS

Top

get_model($this,$c,$self,$id)

This method returns model object having $id. This method must be implemented by sub class.

get_models($this,$c,$self)

This method returns model objects. This method must be implemented by sub class.

SEE ALSO

Top

Catalyst, Catalyst::Plugin::CRUD

AUTHOR

Top

Jun Shimizu, <bayside@cpan.org>

COPYRIGHT AND LICENSE

Top


Catalyst-Plugin-CRUD documentation  | view source Contained in the Catalyst-Plugin-CRUD distribution.