Hello,

Thank you for answer.

No I haven't tried this, because I thought Cake doesn't accept an
association between 2 models with the same name...
In your example, have you created the "joinTable" before creating
HABTM in the model definition?
Is it possible to link YourModel with YourModel and to have
"foreignKey" and "associationForeignKey" with the same name?

BR

Avairet


On 12 fév, 18:43, "b logica" <[EMAIL PROTECTED]> wrote:
> On Feb 12, 2008 11:46 AM, avairet <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi everybody,
>
> > I'm trying to create a "reflexive association", a table HABTM with
> > itself.
> > What is the better way to generate it with Cake?
>
> Have you tried this?
>
> var $name = 'YourModel';
>
> var $hasAndBelongsToMany = array(
>         'YourModel' =>
>                 array('className'            => 'YourModel',
>                         'joinTable'              => 'your_models_your_models',
>                         'foreignKey'             => 'your_model_id',
>                         'associationForeignKey'  => 'your_model_id'
>                 )
>         );
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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