CatalystX-CRUD

 view release on metacpan or  search on metacpan

lib/CatalystX/CRUD/Controller.pm  view on Meta::CPAN


    1;
}

=head2 update

Alias for save(), just for consistency with the U in CRUD.

=cut

sub update : PathPart Chained('fetch') Args(0) {
    my ( $self, $c ) = @_;
    $self->save($c);
}

=head2 rm

Attribute: chained to fetch(), expecting no arguments.

Checks the can_write() and has_errors() methods before proceeeding.

lib/CatalystX/CRUD/ModelAdapter.pm  view on Meta::CPAN

=cut

sub read { shift->throw_error("must implement read()") }

=head2 update( I<context>, I<object> )

Should implement the U in CRUD.

=cut

sub update { shift->throw_error("must implement update()") }

=head2 delete( I<context>, I<object> )

Should implement the D in CRUD.

=cut

sub delete { shift->throw_error("must implement delete()") }

1;

lib/CatalystX/CRUD/ModelAdapter/File.pm  view on Meta::CPAN

    my ( $self, $c, $file ) = @_;
    $file->read;
}

=head2 update( I<context>, I<file_object> )

Implements required CRUD method.

=cut

sub update {
    my ( $self, $c, $file ) = @_;
    $file->update;
}

=head2 delete( I<context>, I<file_object> )

Implements required CRUD method.

=cut

lib/CatalystX/CRUD/Object.pm  view on Meta::CPAN


CatalystX::CRUD::Object - an instance returned from a CatalystX::CRUD::Model

=head1 SYNOPSIS

 package My::Object;
 use base qw( CatalystX::CRUD::Object );
 
 sub create { shift->delegate->save }
 sub read   { shift->delegate->load }
 sub update { shift->delegate->save }
 sub delete { shift->delegate->remove }
 
 1;

=head1 DESCRIPTION

A CatalystX::CRUD::Model returns instances of CatalystX::CRUD::Object.

The assumption is that the Object knows how to manipulate the data it represents,
typically by holding an instance of an ORM or other data model in the

lib/CatalystX/CRUD/REST.pm  view on Meta::CPAN

=cut

sub read { shift->next::method(@_) }

=head2 update( I<context> )

Overrides base method to disable chaining.

=cut

sub update { shift->next::method(@_) }

=head2 postcommit( I<context>, I<object> )

Overrides base method to redirect to REST-style URL.

=cut

sub postcommit {
    my ( $self, $c, $o ) = @_;
    my $id = $self->make_primary_key_string($o);

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.592 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )