relations in cake problem

2008-02-18 Thread andrewharlan
Can any1 help me with this? i understand Post $hasone category and $hasone locality. but can i set category to $belongsto Post and locality as $belongsto Post ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake

Re: relations in cake problem

2008-02-18 Thread avairet
HI Andrew, Yes you can do that! But you must have Post model, Category model and Locality model. Then you put: var $hasOne = array ('Category'= array(), 'Locality'=array()); in your Post model. After that you write: var $belongsTo = 'Post'; in your two other models. Hope this helps...