NAME

DBIO::Relationship::ManyToMany - Declare a many-to-many relationship via a bridge table

VERSION

version 0.900000

METHODS

many_to_many

_m2m_metadata

Accessor for a HASH ref where each key is the name of a many-to-many relationship declared on the Result class, and the value is a HASH ref describing that relationship:

$class->_m2m_metadata->{roles} = {
  accessor         => 'roles',
  relation         => 'user_roles',
  foreign_relation => 'role',
  attrs            => $rel_attrs,   # only present if a 4th arg was given
  rs_method        => 'roles_rs',
  add_method       => 'add_to_roles',
  set_method       => 'set_roles',
  remove_method    => 'remove_from_roles',
};

Installed lazily on the Result class the first time many_to_many is called. Provides the same API as DBIx::Class::IntrospectableM2M.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.