static function postClone(Rule $clone, $oldid) { global $DB; $fkey = getForeignKeyFieldForTable($clone->getTable()); $crit = array($fkey => $oldid); $criteria = new RuleCriteria(); foreach ($DB->request($criteria->getTable(), $crit) as $data) { unset($data['id']); $data[$fkey] = $clone->getID(); $criteria->add(Toolbox::addslashes_deep($data)); } $action = new RuleAction(); foreach ($DB->request($action->getTable(), $crit) as $data) { unset($data['id']); $data[$fkey] = $clone->getID(); $action->add(Toolbox::addslashes_deep($data)); } }