Hey all! Ok.... I looked everywhere. Now I am confuzzled.

I have a simple problem ... I have Products that can have an arbitrary
number of other products "Related" to them. I have a "products" table,
and a "products_products" table. The products_products table has
"product_id" and "related_id" as the fields.

Here is my Product model.

<?php
class Product extends AppModel {

        var $name = 'Product';

        //The Associations below have been created with all possible keys,
those that are not needed can be removed
        var $hasAndBelongsToMany = array(
                        'Related' =>
                                array('className' => 'Product',
                                                'joinTable' => 
'products_products',
                                                'foreignKey' => 'product_id',
                                                'associationForeignKey' => 
'related_id',
                                                'conditions' => '',
                                                'fields' => '',
                                                'order' => '',
                                                'limit' => '',
                                                'offset' => '',
                                                'uniq' => '',
                                                'finderQuery' => '',
                                                'deleteQuery' => '',
                                                'insertQuery' => ''
                                ),

        );

}
?>

However, after a bake creating the controller and views (with sane
options) the edit page, it no work. it lists the other products by name
in a select list, but it never actually stores the associations int he
products_producs table.


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