summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generated-classes/Map/CategoryTableMap.php13
-rw-r--r--generated-classes/Map/ProductCategoryTableMap.php4
-rw-r--r--generated-classes/Map/ProductTableMap.php13
-rw-r--r--schema.xml4
4 files changed, 26 insertions, 8 deletions
diff --git a/generated-classes/Map/CategoryTableMap.php b/generated-classes/Map/CategoryTableMap.php
index b9aef89..39f598f 100644
--- a/generated-classes/Map/CategoryTableMap.php
+++ b/generated-classes/Map/CategoryTableMap.php
@@ -152,9 +152,18 @@ class CategoryTableMap extends TableMap
0 => ':category_id',
1 => ':id',
),
-), null, null, 'ProductCategories', false);
- $this->addRelation('Product', '\\Product', RelationMap::MANY_TO_MANY, array(), null, null, 'Products');
+), 'CASCADE', 'CASCADE', 'ProductCategories', false);
+ $this->addRelation('Product', '\\Product', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'CASCADE', 'Products');
} // buildRelations()
+ /**
+ * Method to invalidate the instance pool of all tables related to category * by a foreign key with ON DELETE CASCADE
+ */
+ public static function clearRelatedInstancePool()
+ {
+ // Invalidate objects in related instance pools,
+ // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
+ ProductCategoryTableMap::clearInstancePool();
+ }
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
diff --git a/generated-classes/Map/ProductCategoryTableMap.php b/generated-classes/Map/ProductCategoryTableMap.php
index 262f098..3597adf 100644
--- a/generated-classes/Map/ProductCategoryTableMap.php
+++ b/generated-classes/Map/ProductCategoryTableMap.php
@@ -147,14 +147,14 @@ class ProductCategoryTableMap extends TableMap
0 => ':category_id',
1 => ':id',
),
-), null, null, null, false);
+), 'CASCADE', 'CASCADE', null, false);
$this->addRelation('Product', '\\Product', RelationMap::MANY_TO_ONE, array (
0 =>
array (
0 => ':product_id',
1 => ':id',
),
-), null, null, null, false);
+), 'CASCADE', 'CASCADE', null, false);
} // buildRelations()
/**
diff --git a/generated-classes/Map/ProductTableMap.php b/generated-classes/Map/ProductTableMap.php
index 820ebc3..db565a0 100644
--- a/generated-classes/Map/ProductTableMap.php
+++ b/generated-classes/Map/ProductTableMap.php
@@ -170,9 +170,18 @@ class ProductTableMap extends TableMap
0 => ':product_id',
1 => ':id',
),
-), null, null, 'ProductCategories', false);
- $this->addRelation('Category', '\\Category', RelationMap::MANY_TO_MANY, array(), null, null, 'Categories');
+), 'CASCADE', 'CASCADE', 'ProductCategories', false);
+ $this->addRelation('Category', '\\Category', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'CASCADE', 'Categories');
} // buildRelations()
+ /**
+ * Method to invalidate the instance pool of all tables related to product * by a foreign key with ON DELETE CASCADE
+ */
+ public static function clearRelatedInstancePool()
+ {
+ // Invalidate objects in related instance pools,
+ // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
+ ProductCategoryTableMap::clearInstancePool();
+ }
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
diff --git a/schema.xml b/schema.xml
index 84b458e..8d37630 100644
--- a/schema.xml
+++ b/schema.xml
@@ -22,10 +22,10 @@
<table name="product_category" idMethod="native" phpName="ProductCategory" isCrossRef="true">
<column name="product_id" phpName="ProductId" type="INTEGER" primaryKey="true" required="true"/>
<column name="category_id" phpName="CategoryId" type="INTEGER" primaryKey="true" required="true"/>
- <foreign-key foreignTable="category" name="product_category_ibfk_1">
+ <foreign-key foreignTable="category" name="product_category_ibfk_1" onUpdate="cascade" onDelete="cascade">
<reference local="category_id" foreign="id"/>
</foreign-key>
- <foreign-key foreignTable="product" name="product_category_ibfk_2">
+ <foreign-key foreignTable="product" name="product_category_ibfk_2" onUpdate="cascade" onDelete="cascade">
<reference local="product_id" foreign="id"/>
</foreign-key>
<index name="category_id">