May be I'm wrong, but I think you should also set the "foreignKey"
keyword in this array so that cakephp nows which key to use for the
hasMany relationship.
Something like :
var $hasMany = array(
'Kids'=>array('className' => 'Human', 'foreignKey'=>'parent_id'),
'Friends'=>array('className' => 'Human', 'foreignKey'=>'friend_id')
);
AD7six wrote:
> There are no restrictions on self joins, and the search function for
> the google group (and the cakeSearch page) works quite well:
> http://groups.google.com/group/cake-php/search?group=cake-php&q=hasMany+self&qt_g=1&searchnow=Search+this+group
>
> The ONLY thing to bear in mind is that the name you give to an
> association must be unique or the generated SQL becomes ambiguous.
>
> By that I mean:
> class Human extends Object {
> var $hasMany = array(
> 'Kids'=>array('className' => 'Human'),
> 'Friends'=>array('className' => 'Human')
> );
> }
>
> HTH,
>
> AD7six
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---