NAME

Data::Morph::Backend::DBIC - Provides a Data::Morph backend for DBIx::Class

VERSION

version 1.110540

DESCRIPTION

Data::Morph::Backend::DBIC implements a Data::Morph backend that talks to a database via DBIx::Class. New instances or rows are created from the passed in DBIx::Class::ResultSet to the constructor. Values are set and retrieved from the row using the following logic: If there is an accessor, use it, if not, see if it has a column, use inflated_columns methods, if not die. So directives defined in the map for reading and writing should match either accessors or column names

PUBLIC_ATTRIBUTES

result_set

is: ro, isa: DBIx::Class::ResultSet, required: 1

This attribute holds the active ResultSet that should be used when creating new rows

auto_insert

is: ro, isa: Bool, default: false

During the execution of the "epilogue", this attribute is checked to see if the newly created and populated instance should be inserted into the database

new_instance

is: ro, isa: CodeRef

This attribute overrides what is provided in Data::Morph::Role::Backend and sets a default that returns a coderef that uses "result_set" to return a new row using "new_result" in DBIx::Class::ResultSet

PUBLIC_METHODS

epilogue

(DBIx::Class::Row)

This method implements "epilogue" in Data::Morph::Role::Backend. It reads "auto_insert" to determine if the row should be inserted into the database.

AUTHOR

Nicholas R. Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Nicholas R. Perez <nperez@cpan.org>.

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