> 'book' hasOne 'mainauthor' AND 'book' hasOne 'assistantauthor'
>
>    var $hasOne = array('Author' =>
>                        array('className'    => 'Author',
>                              'dependent'    =>  false,
>                               'foreignKey'   => 'mainauthor_id'
>                         );
>
>     var $hasOne = array('Author' =>
>                         array('className'    => 'Author',
>                               'dependent'    =>  false,
>                               'foreignKey'   => 'assistantauthor_id'
>                         );
>

The obvious code shows you how: it's an array. So add another element. And
the foreign key should be for Author, since it's the one that hasOne of
those things. Code below.


var $hasOne = array('Author' =>
                                array('className'    => 'Author',
                                    'dependent'    =>  false,
                                    'foreignKey'   => author_id'
                                )
                        ),
                        array('Author' =>
                                array('className'    => 'Author',
                                    'dependent'    =>  false,
                                    'foreignKey'   => 'author_id'
                                )
                        );

Hope it helps. I'm just another noob, too.

Uwie


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