DBIx::Class::Schema::Loader::RelBuilder - Builds relationships for DBIx::Class::Schema::Loader
See DBIx::Class::Schema::Loader and DBIx::Class::Schema::Loader::Base.
This class builds relationships for DBIx::Class::Schema::Loader. This is module is not (yet) for external use.
Arguments: $base object
Arguments: local_moniker (scalar), fk_info (arrayref)
This generates the code for the relationships of a given table.
local_moniker is the moniker name of the table which had the REFERENCES statements. The fk_info arrayref's contents should take the form:
local_moniker
[ { local_columns => [ 'col2', 'col3' ], remote_columns => [ 'col5', 'col7' ], remote_moniker => 'AnotherTableMoniker', }, { local_columns => [ 'col1', 'col4' ], remote_columns => [ 'col1', 'col2' ], remote_moniker => 'YetAnotherTableMoniker', }, # ... ],
This method will return the generated relationships as a hashref keyed on the class names. The values are arrayrefs of hashes containing method name and arguments, like so:
{ 'Some::Source::Class' => [ { method => 'belongs_to', arguments => [ 'col1', 'Another::Source::Class' ], { method => 'has_many', arguments => [ 'anothers', 'Yet::Another::Source::Class', 'col15' ], ], 'Another::Source::Class' => [ # ... ], # ... }
See "AUTHOR" in DBIx::Class::Schema::Loader and "CONTRIBUTORS" in DBIx::Class::Schema::Loader.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBIx::Class::Schema::Loader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::Schema::Loader
CPAN shell
perl -MCPAN -e shell install DBIx::Class::Schema::Loader
For more information on module installation, please visit the detailed CPAN module installation guide.