Just model it like a normal HABTM relationship, no special syntaxis, and add the field in the database.
When saving, try this: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/ I haven't done it before, so i can't secure his fiability, but looks good. On Mar 11, 10:38 am, mattalexx <[email protected]> wrote: > What's the syntax for adding an "extra field" to the > $hasAndBelongsToMany var? > > Thank you for you response. > > On Mar 11, 2:43 am, Xoubaman <[email protected]> wrote: > > > You can model it like a normal HABTM relationship with an extra field > > named main_photo. > > > On Mar 11, 8:30 am, mattalexx <[email protected]> wrote: > > > > My articles have and belong to many photos. This is so when the photo > > > is seen somewhere else on the site, I can have a "see related > > > articles". Each article also has one main photo. I can't seem to > > > figure out the syntax for this in APP/models/article.php file and in > > > APP/models/photo.php. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
