Freeside:3:Documentation:Developer/FS/m2m Common
From Freeside
< Freeside:3:Documentation:Developer | FS
Revision as of 21:05, 27 June 2012 by Ivan (talk | contribs) (Edit via perl MediaWiki framework (1.13))
NAME
FS::m2m_Common - Mixin class for classes in a many-to-many relationship
SYNOPSIS
use FS::m2m_Common;
@ISA = qw( FS::m2m_Common FS::Record );
DESCRIPTION
FS::m2m_Common is intended as a mixin class for classes which have a many-to-many relationship with another table (via a linking table).
It is currently assumed that the link table contains two fields named the same as the primary keys of the base and target tables, but you can ovverride this assumption if your table is different.
METHODS
- process_m2m OPTION => VALUE, ...
- Available options:
- link_table (required)
- ; target_table (required):; params (required)
- hashref; keys are primary key values in target_table (values are boolean). For convenience, keys may optionally be prefixed with the name of the primary key, as in "agentnum54" instead of "54", or passed as an arrayref of values.
- base_field (optional)
- base field, defaults to primary key of this base table
- target_field (optional)
- target field, defaults to the primary key of the target table
- hashref (optional)
- static hashref further qualifying the m2m fields
BUGS
SEE ALSO
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 161:
- You forgot a '=back' before '=head1'