original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Get the mform field for lawful bases.
  
  @param   string  $prefix The prefix to apply to the field
  @return  \stdClass
docstring_tokens: Get the mform field for lawful bases .