original_string: public static function can_all_be_deleted($ids) {
          global $CFG;
  
          if (empty($ids)) {
              return true;
          }
          // Check if competency is used in template.
          if (template_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in plan.
          if (plan_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in course.
          if (course_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in user_competency.
          if (user_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in user_competency_plan.
          if (user_competency_plan::has_records_for_competencies($ids)) {
              return false;
          }
  
          require_once($CFG->libdir . '/badgeslib.php');
          // Check if competency is used in a badge.
          if (badge_award_criteria_competency_has_records_for_competencies($ids)) {
              return false;
          }
  
          return true;
      }
code: public static function can_all_be_deleted($ids) {
          global $CFG;
  
          if (empty($ids)) {
              return true;
          }
          // Check if competency is used in template.
          if (template_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in plan.
          if (plan_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in course.
          if (course_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in user_competency.
          if (user_competency::has_records_for_competencies($ids)) {
              return false;
          }
          // Check if competency is used in user_competency_plan.
          if (user_competency_plan::has_records_for_competencies($ids)) {
              return false;
          }
  
          require_once($CFG->libdir . '/badgeslib.php');
          // Check if competency is used in a badge.
          if (badge_award_criteria_competency_has_records_for_competencies($ids)) {
              return false;
          }
  
          return true;
      }
code_tokens: public static function can_all_be_deleted ( $ ids ) { global $ CFG ; if ( empty ( $ ids ) ) { return true ; } // Check if competency is used in template. if ( template_competency :: has_records_for_competencies ( $ ids ) ) { return false ; } // Check if competency is used in plan. if ( plan_competency :: has_records_for_competencies ( $ ids ) ) { return false ; } // Check if competency is used in course. if ( course_competency :: has_records_for_competencies ( $ ids ) ) { return false ; } // Check if competency is used in user_competency. if ( user_competency :: has_records_for_competencies ( $ ids ) ) { return false ; } // Check if competency is used in user_competency_plan. if ( user_competency_plan :: has_records_for_competencies ( $ ids ) ) { return false ; } require_once ( $ CFG -> libdir . '/badgeslib.php' ) ; // Check if competency is used in a badge. if ( badge_award_criteria_competency_has_records_for_competencies ( $ ids ) ) { return false ; } return true ; }
docstring: Check if we can delete competencies safely.
  
  This moethod does not check any capablities.
  Check if competency is used in a plan and user competency.
  Check if competency is used in a template.
  Check if competency is linked to a course.
  
  @param array $ids Array of competencies ids.
  @return bool True if we can delete the competencies.
docstring_tokens: Check if we can delete competencies safely .