[eluser]hot_sauce[/eluser]
Hi, i have 3 tables: categories,products,categories_products
categories has many products
products has many categories
Code:
categories
-- Table --
id,parent_id
-- Model --
class Category extends DataMapper {
var $has_many = array(
'product'
);
}
******************************************
Products
-- Table --
id,name
-- Model --
class Product extends DataMapper {
var $has_many = array(
'category'
);
}
******************************************
categories_products
-- Table --
id,category_id,product_id,name
I want to create a new category and create automatically categories_products associations but it doesn't works
my controller
Code:
$p = new Product();
$p->get();
$c = new Category();
$c->product->save($p->all);
I don’t understand… I have no idea how to do it

Any help would be really appreciated.
Thanks!