On Jul 18, 2006, at 10:35 AM, calzone wrote:
>
> Hi John, I tried your second approach but got a very large number of
> notices. I could turn these off of course, but I'd rather not them be
> generated in the first place if I can avoid it.
Might help to include them here. :)
> In my case, I have a member model and a character model. The member
> model has a primary_chracter_id while every character has a member_id.
> The idea being that a member can have many characters, but has one
> special character.
I might key it different then.
Member hasMany Character (so there needs to be a Character.member_id
field).
Member hasOne Character (so there needs to be a
Character.special_member_id field).
<?php
class Member extends AppModel
{
var $hasMany = array('Character' => array('className' => 'Member'));
var $hasOne = array('SpecialCharacter' => array('className' =
'Member', 'foreignKey' => 'special_member_id'));
}
?>
Totally off the cuff, but that should get you pretty close...
-- J
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---