1DBIx::Class::Schema::LoUasdeerr:C:oRnetlrBiubiultdeDedBrI(Px3e:)r:lClDaoscsu:m:eSncthaetmiao:n:Loader::RelBuilder(3)
2
3
4

NAME

6       DBIx::Class::Schema::Loader::RelBuilder - Builds relationships for
7       DBIx::Class::Schema::Loader
8

SYNOPSIS

10       See DBIx::Class::Schema::Loader and DBIx::Class::Schema::Loader::Base.
11

DESCRIPTION

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

METHODS

17   new
18       Arguments: $loader object
19
20   generate_code
21       Arguments:
22
23           [
24               [ local_moniker1 (scalar), fk_info1 (arrayref), uniq_info1 (arrayref) ]
25               [ local_moniker2 (scalar), fk_info2 (arrayref), uniq_info2 (arrayref) ]
26               ...
27           ]
28
29       This generates the code for the relationships of each table.
30
31       "local_moniker" is the moniker name of the table which had the
32       REFERENCES statements.  The fk_info arrayref's contents should take the
33       form:
34
35           [
36               {
37                   local_table    => 'some_table',
38                   local_moniker  => 'SomeTable',
39                   local_columns  => [ 'col2', 'col3' ],
40                   remote_table   => 'another_table_moniker',
41                   remote_moniker => 'AnotherTableMoniker',
42                   remote_columns => [ 'col5', 'col7' ],
43               },
44               {
45                   local_table    => 'some_other_table',
46                   local_moniker  => 'SomeOtherTable',
47                   local_columns  => [ 'col1', 'col4' ],
48                   remote_table   => 'yet_another_table_moniker',
49                   remote_moniker => 'YetAnotherTableMoniker',
50                   remote_columns => [ 'col1', 'col2' ],
51               },
52               # ...
53           ],
54
55       The uniq_info arrayref's contents should take the form:
56
57           [
58               [
59                   uniq_constraint_name         => [ 'col1', 'col2' ],
60               ],
61               [
62                   another_uniq_constraint_name => [ 'col1', 'col2' ],
63               ],
64           ],
65
66       This method will return the generated relationships as a hashref keyed
67       on the class names.  The values are arrayrefs of hashes containing
68       method name and arguments, like so:
69
70           {
71               'Some::Source::Class' => [
72                   { method => 'belongs_to', arguments => [
73                     'col1', 'Another::Source::Class' ] },
74                   { method => 'has_many', arguments => [
75                     'anothers', 'Yet::Another::Source::Class', 'col15' ] },
76               ],
77               'Another::Source::Class' => [
78                   # ...
79               ],
80               # ...
81           }
82

AUTHORS

84       See "AUTHORS" in DBIx::Class::Schema::Loader.
85

LICENSE

87       This library is free software; you can redistribute it and/or modify it
88       under the same terms as Perl itself.
89
90
91
92perl v5.28.0                      201D8B-I0x3:-:2C1lass::Schema::Loader::RelBuilder(3)
Impressum