5 use base 'DBIx::Class';
7 __PACKAGE__->mk_classdata( _m2m_metadata => {} );
11 my ($meth_name, $link, $far_side) = @_;
12 my $store = $class->_m2m_metadata;
13 die "You are overwritting another relationship's metadata"
14 if exists $store->{$meth_name};
17 accessor => $meth_name,
18 relation => $link, #"link" table or immediate relation
19 foreign_relation => $far_side, #'far' table or foreign relation
20 (@_ > 3 ? (attrs => $_[3]) : ()), #only store if exist
23 #inheritable data workaround
24 $class->_m2m_metadata({ $meth_name => $attrs, %$store});
25 $class->next::method(@_);