>
> class User extends AppModel {
> var $name = 'User';
> }
>
> class Review extends AppModel {
> var $name = 'Review';
>
> var $hasOne = array('User' =>
> array('className' => 'User',
> 'conditions' => '',
> 'order' => '',
> 'dependent' => false,
> 'foreignKey' => 'user_id'
> )
> );

I don't know if this is your problem, but it looks like you should be
using 'belongsTo' instead of 'hasOne'. If a review has one user, then
the user should have a field 'review_id'. What you want to say is that
the review belongs to a user (ie. review has a 'user_id') field.

To remember this, think in terms of 'hasMany' -- if a review has many
users, then the review would need many 'user_id' fields -- which
doesn't work, therefore the field has to be in User (review_id).
'hasOne' is just a special case of 'hasMany'.

Hope this makes sense,
Anselm


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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