protected static function get_definitions_for_component($componentname) {
        global $DB;
        list($a, $b) = core_component::normalize_component($componentname);
        $component = $b ? ($a . '_' . $b) : $a;
        $sql = 'component = :component';
        $params = array('component' => $component);
        if ($component === 'core') {
            $sql .= ' OR component LIKE :coreprefix';
            $params['coreprefix'] = 'core_%';
        }
        $fields = $DB->sql_concat_join("':'", array('itemtype', 'component'));
        $existingareas = $DB->get_records_sql(
                "SELECT $fields AS returnkey, a.* FROM {tag_area} a WHERE $sql", $params);
        $fields = $DB->sql_concat_join("':'", array('name', 'component'));
        $existingcolls = $DB->get_records_sql(
                "SELECT $fields AS returnkey, t.* FROM {tag_coll} t WHERE $sql", $params);
        return array($existingareas, $existingcolls);

    }