DBIx::Class::Schema::Loader::RelBuilder 0.03007
DBIx::Class::Schema::Loader::RelBuilder is a Perl module that builds relationships for DBIx::Class::Schema::Loader. This class bui
|
|||||||||||||||||||
DBIx::Class::Schema::Loader::RelBuilder is a Perl module that builds relationships for DBIx::Class::Schema::Loader.
This class builds relationships for DBIx::Class::Schema::Loader. This is module is not (yet) for external use.
METHODS
new
Arguments: schema_class (scalar), fk_info (hashref), inflect_plural, inflect_singular
$schema_class should be a schema class name, where the source classes have already been set up and registered. Column info, primary key, and unique constraints will be drawn from this schema for all of the existing source monikers.
The fk_info hashref's contents should take the form:
{
TableMoniker => [
{
local_columns => [ 'col2', 'col3' ],
remote_columns => [ 'col5', 'col7' ],
remote_moniker => 'AnotherTableMoniker',
},
# ...
],
AnotherTableMoniker => [
# ...
],
# ...
}
Options inflect_plural and inflect_singular are optional, and are better documented in DBIx::Class::Schema::Loader::Base.
generate_code
This method will return the generated relationships as a hashref per table moniker, containing an arrayref of code strings which can be "eval"-ed in the context of the source class, like:
{
'Some::Source::Class' => [
"belongs_to( col1 => 'AnotherTableMoniker' )",
"has_many( anothers => 'AnotherTableMoniker', 'col15' )",
],
'Another::Source::Class' => [
# ...
],
# ...
}
You might want to use this in building an on-disk source class file, by adding each string to the appropriate source class file, prefixed by __PACKAGE__->.
Requirements:
tags
Download DBIx::Class::Schema::Loader::RelBuilder 0.03007
Authors software
|
|
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
