The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CatalystX::CRUD::ModelAdapter::DBIC - CRUD for Catalyst::Model::DBIC::Schema

SYNOPSIS

 # create an adapter class (NOTE not in ::Model namespace)
 package MyApp::MyDBICAdapter;
 use strict;
 use base qw( CatalystX::CRUD::ModelAdapter::DBIC );
 
 1;
 
 # your main DBIC::Schema model
 package MyApp::Model::MyDBIC;
 use strict;
 use base qw( Catalyst::Model::DBIC::Schema );
 
 1;
 

DESCRIPTION

CatalystX::CRUD::ModelAdapter::DBIC implements the CatalystX::CRUD::ModelAdapter API for DBIx::Class.

METHODS

new( opts )

Overrides base method to initialize treats_like_int, ne_sign and use_ilike values.

new_object( controller, context, moniker )

Implement required method. Returns empty new_result() object from resultset() of moniker.

fetch( controller, context, moniker [, args] )

Implements required method. Returns new_object() matching args. args is passed to the find() method of the resultset() for moniker. If args is not passed, fetch() acts the same as calling new_object().

search( controller, context, args )

Implements required method. Returns array or array ref, based on calling context, for a search() in resultset() for args.

iterator( controller, context, args )

Implements required method. Returns iterator for a search() in resultset() for args.

count( controller, context, args )

Implements required method. Returns count() in resultset() for args.

make_query( controller, context [, field_names ] )

Returns an array ref of query data based on request params in context, using param names that match field_names.

make_sql_query( controller, context, field_names )

Override method in CatalystX::CRUD::Model::Utils to mimic ACCEPT_CONTEXT by setting context in $self.

Otherwise, acts just like CatalystX::CRUD::Model::Utils->make_sql_query().

search_related( controller, context, obj, relationship [, query ] )

Implements required method. Returns array ref of objects related to obj via relationship. relationship should be a method name callable on obj.

iterator_related( controller, context, obj, relationship [, query ] )

Like search_related() but returns an iterator.

count_related( controller, context, obj, relationship [, query ] )

Like search_related() but returns an integer.

add_related( controller, context, obj, rel_name, foreign_value )

Implements optional method as defined by core API. rel_name should be a method name callable by obj.

rm_related( controller, context, obj, rel_name, foreign_value )

Implements optional method as defined by core API. rel_name should be a method name callable by obj.

has_relationship( controller, context, obj, rel_name )

Implements optional method as defined by core API. rel_name should be a method name callable by obj.

create( context, dbic_object )

Calls insert() on dbic_object.

read( context, dbic_object )

Calls find() on dbic_object.

update( context, dbic_object )

Calls update() on dbic_object.

delete( context, dbic_object )

Calls delete() on dbic_object.

AUTHOR

Peter Karman, <karman at cpan.org>

BUGS

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

SUPPORT

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

    perldoc CatalystX::CRUD::ModelAdapter::DBIC

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2008 Peter Karman, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.