DBIx::Class::Schema::Loader::RelBuilder man page on Pidora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Pidora logo
[printable version]

DBIx::Class::Schema::LUserrContributDBIx::Class::Schema::Loader::RelBuilder(3)

NAME
       DBIx::Class::Schema::Loader::RelBuilder - Builds relationships for
       DBIx::Class::Schema::Loader

SYNOPSIS
       See DBIx::Class::Schema::Loader and DBIx::Class::Schema::Loader::Base.

DESCRIPTION
       This class builds relationships for DBIx::Class::Schema::Loader.	 This
       is module is not (yet) for external use.

METHODS
   new
       Arguments: $loader object

   generate_code
       Arguments:

	   [
	       [ local_moniker1 (scalar), fk_info1 (arrayref), uniq_info1 (arrayref) ]
	       [ local_moniker2 (scalar), fk_info2 (arrayref), uniq_info2 (arrayref) ]
	       ...
	   ]

       This generates the code for the relationships of each 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_table	  => 'some_table',
		   local_moniker  => 'SomeTable',
		   local_columns  => [ 'col2', 'col3' ],
		   remote_table	  => 'another_table_moniker',
		   remote_moniker => 'AnotherTableMoniker',
		   remote_columns => [ 'col5', 'col7' ],
	       },
	       {
		   local_table	  => 'some_other_table',
		   local_moniker  => 'SomeOtherTable',
		   local_columns  => [ 'col1', 'col4' ],
		   remote_table	  => 'yet_another_table_moniker',
		   remote_moniker => 'YetAnotherTableMoniker',
		   remote_columns => [ 'col1', 'col2' ],
	       },
	       # ...
	   ],

       The uniq_info arrayref's contents should take the form:

	   [
	       [
		   uniq_constraint_name		=> [ 'col1', 'col2' ],
	       ],
	       [
		   another_uniq_constraint_name => [ 'col1', 'col2' ],
	       ],
	   ],

       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' => [
		 # ...
	     ],
	     # ...
	 }

AUTHOR
       See "AUTHOR" in DBIx::Class::Schema::Loader and "CONTRIBUTORS" in
       DBIx::Class::Schema::Loader.

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

perl v5.14.2			  20DBIx::Class::Schema::Loader::RelBuilder(3)
[top]

List of man pages available for Pidora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net