开发者

Zend db cascade delete multiple levels

How does one make Zend Db cascade delete multiple levels of th开发者_JAVA技巧e hierarchy? For example:

dealers -> products -> attributes

deleting one dealer should go all the way down to attributes, and now it doesn't :(

Any thoughts?


On row of the Zend_Table_Abstract within the function _cascadeDelete a row is constructed like this:

$rowsAffected += $this->delete($where);

It should instead be constructed as something like this:

$toDelete = $this->fetchAll($where);  
foreach($toDelete as $row) {  
    $rowsAffected += $row->delete();  
}  

More info here. It's worked for me in one cause but need to test more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜