beginTransaction(); $eids = getAffectedIds('eids'); ZM\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\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' ) { $deletedEids = getAffectedIds('eids'); foreach ( $deletedEids as $markEid ) { deleteEvent($markEid); } ZM\AuditAction('delete', 'events', 0, 'Count: '.count($deletedEids)); $refreshParent = true; } else { ZM\Warning("Unsupported action $action in events"); } ?>