Grady, This recent post talks about setting up multiple relationships http://groups.google.com/group/cake-php/browse_thread/thread/b70eb9498e2bbd58?hl=en
Don On Mar 8, 12:27 pm, grady <[email protected]> wrote: > I posted a question similar to the following on the unofficial CakePHP > forums over a week ago and haven't received any sort of response, and > then I noticed the google group so here is my second attempt... > > I'm working on a site mainly to get my feet wet with CakePHP and I > realized that I am unsure of how to go about laying out my database > tables to play nice with CakePHP. > > Basically my site centers around artifacts, which have names, > descriptions, and one or more assets (images, sounds, videos, etc.) > related to them. In my database I have an artifact table and an asset > table. I have set up the relationship so that the artifact > hasAndBelongsToMany assets (and vic versa). (So I also have an > artifacts_assets table to accommodate this). So far so good. > > In addition to an artifact having a couple assets, I would like to be > able to designate an image file (which is, in my mind, another asset) > as the preview image for each artifact. I have set it up so that in > addition to the HABTM relationship between artifacts and assets, there > is another relationship -- artifact belongsTo asset which is set up on > a "preview_id" foreign key in the artifact table. > > This seems right, but I believe CakePHP is choking on the multiple > relationships. For instance, I set up a form using the Form helper > and setting the value of $this->Form->input("preview_id") doesn't grab > any of the assets for selection. This leads me to believe that I am > going about this the wrong way, and would be grateful to anyone who > could point me in the right direction. > > Thanks! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
