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);
        }
    }
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);
        }
    }
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 ) ; } }
Bulk delete all tag instances by tag id.

@param int[] $taginstanceids List of tag instance ids to be deleted.
Bulk delete all tag instances by tag id .