DBIx::DataModel::Meta::Path - meta-information about a path
# create the path; best called through $assoc->_install_path(...) my $path = new ( name => $role_name, from => $source_meta_table, to => $destination_meta_table, on => \%condition, # in SQL::Abstract::More format multiplicity => [$min, $max], association => $association, direction => $direction, # either 'AB' or 'BA' );
This class is closely related to DBIx::DataModel::Meta::Association. A path corresponds to one possible database join between two tables.
Constructor method. Normally this will be called indirectly through
$association->_install_path(%args)
because the "_install_path" in DBIx::DataModel::Meta::Association method automatically adds its own invocant (the $association) into %args.
$association
%args
Named arguments to new() are :
new()
The name of this path (must be unique within the source table). That name is used for defining a Perl method in the class associated to the source table, and for interpreting multi-steps joins in calls like
$schema->join(qw/FirstTable role1 role2 .../)
The DBIx::DataModel::Meta::Source::Table instance which is the source for this path.
The DBIx::DataModel::Meta::Source::Table instance which is the target for this path.
A hashref that describes the database join condition : the keys are names of columns for the left-hand side, and values are names of columns for the right-hand side. For example
on => {foreign_1 => 'primary_1', foreign_2 => 'primary_2'}
will generate SQL clauses of shape
.. JOIN ON <left>.foreign_1 = <right>.primary_1 AND <left>.foreign_2 = <right>.primary_2
An arrayref [$min, $max]; see explanations in DBIx::DataModel::Meta::Association.
[$min, $max]
The association to which this path belongs.
A string that describes the direction of this path within the association : must be either 'AB' or 'BA'.
'AB'
'BA'
Name of this path
Source of this path (an instance of DBIx::DataModel::Meta::Source::Table).
Target of this path (an instance of DBIx::DataModel::Meta::Source::Table).
Copy of the hash for the join condition
Array ($min, $max) describing the multiplicity.
($min, $max)
Instance of DBIx::DataModel::Meta::Association to which this path belongs.
Direction of the path within the association; a string containing either 'AB' or 'BA'.
Returns the path object representing the opposite direction.
To install DBIx::DataModel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::DataModel
CPAN shell
perl -MCPAN -e shell install DBIx::DataModel
For more information on module installation, please visit the detailed CPAN module installation guide.