/** * We need to decide conditionally, based on dynamic information * about the execution of this step. Only will be executed if all * the module gradeitems have been already included in backup */ protected function execute_condition() { return backup_plan_dbops::require_gradebook_backup($this->get_courseid(), $this->get_backupid()); }
/** * Limit the execution. * * This applies the same logic than the one applied to {@link backup_gradebook_structure_step}, * because we do not want to save the history of items which are not backed up. At least for now. */ protected function execute_condition() { $courseid = $this->get_courseid(); if ($courseid == SITEID) { return false; } return backup_plan_dbops::require_gradebook_backup($courseid, $this->get_backupid()); }