Mark Wright-3 wrote:
> 
> When you use a reference map and dependent tables for cascading row
> deletion in the dependent tables how are those rows deleted? Does the
> table class issue a sql delete statement or does it go through the row
> object? The reason I ask is that I need it to go through the row
> object's delete() method so that I can do some cleanup (deleting files
> and caches) with _postDelete(). Will I need to override a
> zend_db_table method to accomplish this?
> 
> 
> Mark
> 
> -- 
> Have fun or die trying - but try not to actually die.
> 
> 

I haven't used it myself but studied the source code of
Zend_Db_Table_Abstract and Zend_Db_Table_Row last week and dependencies are
only triggered when you work on the Zend_Db_Table_Row of the main table.
When you call delete() or update() on the Zend_Db_Table_Row, it will call
it's associated Zend_Db_Table's cascading method which will then call the
delete() and update() on the "dependant" Zend_Db_Table, which has been
created dynamically by the Zend_Db_Table_Row of your initial table.

Bottom line, calling delete() or delete() on a Zend_Db_Table_Row will
trigger delete() and update() on a Zend_Db_Table.

If you call delete() or update() on a Zend_Db_Table, it *won't* use the
dependencies/trigger system.
-- 
View this message in context: 
http://www.nabble.com/about-zend_db_table-and-cascading-deletes-tp22020576p22043801.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to