CatalystX::CRUD::Object::RDBO - Rose::DB::Object implementation of CatalystX::CRUD::Object


CatalystX-CRUD-Model-RDBO documentation Contained in the CatalystX-CRUD-Model-RDBO distribution.

Index


Code Index:

NAME

Top

CatalystX::CRUD::Object::RDBO - Rose::DB::Object implementation of CatalystX::CRUD::Object

SYNOPSIS

Top

 # fetch a row from MyApp::Model::Foo (which isa CatalystX::CRUD::Model)
 my $foo = $c->model('Foo')->fetch( id => 1234 );
 $foo->create;
 $foo->read;
 $foo->update;
 $foo->delete;

DESCRIPTION

Top

CatalystX::CRUD::Object::RDBO implements the required CRUD methods of a CatalystX::CRUD::Object subclass. It is intended for use with CatalystX::CRUD::Model::RDBO.

METHODS

Top

Only new or overridden methods are documented here.

load_speculative

Calls load( speculative => 1 ) on the internal delegate() value.

create

Calls delegate->save().

read

Calls delegate->load(). NOTE: If you need a speculative load, use load_speculative() instead.

update

Calls delegate->save().

delete

Calls delegate->delete(@_).

AUTHOR

Top

Peter Karman, <karman at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-catalystx-crud-model-rdbo at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-CRUD-Model-RDBO. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc CatalystX::CRUD::Model::RDBO

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/CatalystX-CRUD-Model-RDBO

* CPAN Ratings

http://cpanratings.perl.org/d/CatalystX-CRUD-Model-RDBO

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-CRUD-Model-RDBO

* Search CPAN

http://search.cpan.org/dist/CatalystX-CRUD-Model-RDBO

ACKNOWLEDGEMENTS

Top

This module is based on Catalyst::Model::RDBO by the same author.

COPYRIGHT & LICENSE

Top


CatalystX-CRUD-Model-RDBO documentation Contained in the CatalystX-CRUD-Model-RDBO distribution.
package CatalystX::CRUD::Object::RDBO;
use strict;
use warnings;
use base qw( CatalystX::CRUD::Object );

our $VERSION = '0.22';

# convenience methods
sub load_speculative {
    shift->delegate->load( speculative => 1, @_ );
}

# required methods
sub create {
    shift->delegate->save(@_);
}

sub read {

    # because of the abusive way RDBO handles load() internally,
    # must re-assign to delegate afterwards. This fixes esp the issue
    # of passing 'with' => 'rel' to load().

    my $cxcobj = shift;
    my $rdbo   = $cxcobj->delegate;
    $rdbo->load(@_);
    $cxcobj->{delegate} = $rdbo;
    return $cxcobj;
}

sub update {
    shift->delegate->save(@_);
}

sub delete {
    shift->delegate->delete(@_);
}

1;

__END__