MANY-MANY relation and save

Hi,

i have two objects with MANY-MANY and HAS-MANY relations trough a table named oggetti_supporti;

The question is… how can i save a new Oggetto object and so a new oggetti_supporto record at hte same time?

Is it possible?

Thanks,

Riccardo

Objects relations are these:

– Supporto object –

public function relations()

    {


            return array(


              'oggetto_er'=>array(self::HAS_MANY, 'Oggetto', 'oggetti_supporti(id_oggetto,id_supporto)')),


             );


    }

– Oggetto object –

public function relations()

    {


            return array(


               'supporto_er'=>array(self::MANY_MANY, 'Supporto','oggetti_supporti(id_oggetto,id_supporto)'),


            );


    }

Hi,

I have had the same problem. I solved this with this extension and it works very well:

http://www.yiiframework.com/extension/cadvancedarbehavior/

Mantus