protected function get_lawful_base_field(string $prefix = '') : \stdClass {
        $fieldname = "{$prefix}lawfulbases";

        $data = (object) [
            'fields' => [],
        ];

        $bases = [];
        foreach (\tool_dataprivacy\purpose::GDPR_ART_6_1_ITEMS as $article) {
            $key = 'gdpr_art_6_1_' . $article;
            $bases[$key] = get_string("{$key}_name", 'tool_dataprivacy');
        }

        $data->fields[] = $this->_form->createElement('autocomplete', $fieldname, get_string('lawfulbases', 'tool_dataprivacy'),
            $bases,
            [
                'multiple' => true,
            ]
        );

        $data->helps = [
            $fieldname => ['lawfulbases', 'tool_dataprivacy'],
        ];

        $data->advanceds = [
            $fieldname => true,
        ];

        return $data;
    }