Hi,
I have CakePHP app in which I'd like to attach gallery to multiple resources. Let's say I've got artists, each one has own gallery. I've got articles, every article has some images attached to it and so on. Now I set up tables like this:
- Artists hasMany Artistimages, fields in
artistimagestable are:id, artist_id, filename, filetype, filesizeetc. - Articles hasMany Articleimages, fields in
articleimagestable are:id, article_id, filename, filetype, filesizeetc.
...but this is not how it should be, I think.
Is there possibility to have one table called for example uploads which will contain all images with foreign key pointing to resource its reffering to? How to tell CakePHP which image is coming from which resource?