beginTransaction(); $eids = getAffectedIds('eids'); ZM\Logger::Debug("E IDS" . print_r($eids, true)); foreach ( $eids as $markEid ) { dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array(1, $markEid)); } $dbConn->commit(); $refreshParent = true; } else if ( $action == 'unarchive' ) { $dbConn->beginTransaction(); $eids = getAffectedIds('eids'); ZM\Logger::Debug("E IDS" . print_r($eids, true)); foreach ( $eids as $markEid ) { dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array(0, $markEid)); } $dbConn->commit(); $refreshParent = true; } else if ( $action == 'delete' ) { foreach ( getAffectedIds('eids') as $markEid ) { deleteEvent($markEid); } $refreshParent = true; } else { ZM\Warning("Unsupported action $action in events"); } ?>