On Oct 17, 2008, at 7:41 AM, monk.e.boy wrote:
I just stepped through the code and Row->delete calls cascadeDelete, but
when this runs it calls Db->delete for each child table. Db->delete does
_NOT_ call cascadeDelete :-(
So this only cascades one level deep as far as I can tell. Weird. You'd
imagine it'd be recursive?!
Right, it only goes one level down in the current implementation. Truth be told, I regret that it does even that much. Cascading operations should be handled by the database engine, because they are not atomic when they are run from the client.
If you want cascading operations, then you should use a storage engine that supports these operations in the database. This means you shouldn't use MyISAM for cascading operations.
Sorry to reply to myself, but in the $_referenceMap, what do the rule names
mean? I just use random names... is this my problem?
There are examples in the documentation, e.g.:
$bug->findParentAccountsByEngineer();
Where 'Engineer' is the rule name.
Regards,
Bill Karwin
没有评论:
发表评论