This is an example of a hasManyToMany
:
$this->hasManyToMany(
'id',
'RobotsParts',
'robots_id', 'parts_id',
'Parts',
'id'
);
As far as I know, the args mean this, but my hasmanytomany relationships aren't working, so maybe i'm wrong!
hasManyToMany(
$idColumnNameOnLocalTable,
$middleTableClassName,
$columnonMiddleTableThatPointsToLocalTable,
$columnOnMiddleTableThatPointsToForeignModel,
$foreignModelClassName,
$columnOnForeignTableThatIsTheIdColumn
)
Is this right?
Also, is it possible to have a many-to-many to the same model? e.g. products and related products