On Tue, Jun 2, 2009 at 2:00 PM, Petter <[email protected]> wrote:
>
> On Jun 2, 3:29 pm, Marcelo Andrade <[email protected]> wrote:
>> (..)
>> Did you try to put a foreignKey like upload_id in your Car, House
>> models?  In this case your associations should be "Car belongsTo Upload"
>> and "Upload hasOne Car", "Upload hasOne House" and so on.
>>
>> Best regards.
>
>
> Sorry if I was vague: each model hasMany uploads (you can have three
> pictures of the same car, for example). If they could only have one,
> I'd solve it as you say.
>
> Best regards,
> Petter Brodin

Oh... Okay.  In that case the HABTM association is pretty much
adequate.  But I think you're looking for how to bind the models
programatically.  I never did it before, but maybe the cookbook
should help:

http://book.cakephp.org/view/86/Creating-and-Destroying-Associations-on-the-Fly

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

http://mfandrade.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to