original_string: public static function delete_instances_by_id(array $taginstanceids) {
          global $DB;
  
          if (empty($taginstanceids)) {
              return;
          }
  
          list($idsql, $params) = $DB->get_in_or_equal($taginstanceids);
          $sql = "SELECT ti.*, t.name, t.rawname, t.isstandard
                    FROM {tag_instance} ti
                    JOIN {tag} t
                      ON ti.tagid = t.id
                   WHERE ti.id {$idsql}";
  
          if ($taginstances = $DB->get_records_sql($sql, $params)) {
              static::delete_instances_as_record($taginstances);
          }
      }
code: public static function delete_instances_by_id(array $taginstanceids) {
          global $DB;
  
          if (empty($taginstanceids)) {
              return;
          }
  
          list($idsql, $params) = $DB->get_in_or_equal($taginstanceids);
          $sql = "SELECT ti.*, t.name, t.rawname, t.isstandard
                    FROM {tag_instance} ti
                    JOIN {tag} t
                      ON ti.tagid = t.id
                   WHERE ti.id {$idsql}";
  
          if ($taginstances = $DB->get_records_sql($sql, $params)) {
              static::delete_instances_as_record($taginstances);
          }
      }
code_tokens: public static function delete_instances_by_id ( array $ taginstanceids ) { global $ DB ; if ( empty ( $ taginstanceids ) ) { return ; } list ( $ idsql , $ params ) = $ DB -> get_in_or_equal ( $ taginstanceids ) ; $ sql = "SELECT ti.*, t.name, t.rawname, t.isstandard
                    FROM {tag_instance} ti
                    JOIN {tag} t
                      ON ti.tagid = t.id
                   WHERE ti.id {$idsql}" ; if ( $ taginstances = $ DB -> get_records_sql ( $ sql , $ params ) ) { static :: delete_instances_as_record ( $ taginstances ) ; } }
docstring: Bulk delete all tag instances by tag id.
  
  @param int[] $taginstanceids List of tag instance ids to be deleted.
docstring_tokens: Bulk delete all tag instances by tag id .