<commit_before><?php

/**
 * Support class for the module
 *
 * @author Koala
 */
class ExcelImportExport
{

    public static function allFieldsForClass($class)
    {
        $fields = array_keys(DataObject::database_fields($class));
        return array_combine($fields, $fields);
    }

    public static function exportFieldsForClass($class)
    {
        $singl = singleton($class);
        if ($singl->hasMethod('exportedFields')) {
            return $singl->exportedFields();
        }
        $exportedFields = Config::inst()->get($class, 'exported_fields');

        if (!$exportedFields) {
            $exportedFields = array_keys(self::allFieldsForClass($class));
        }

        $unexportedFields = Config::inst()->get($class, 'unexported_fields');

        if ($unexportedFields) {<commit_msg>all fields should also include fields of ancestor classes<commit_after><?php

/**
 * Support class for the module
 *
 * @author Koala
 */
class ExcelImportExport
{

    public static function allFieldsForClass($class)
    {
        $dataClasses = ClassInfo::dataClassesFor($class);
        $fields      = array();
        foreach ($dataClasses as $dataClass) {
            $fields = array_merge($fields,
                array_keys(DataObject::database_fields($dataClass)));
        }
        return array_combine($fields, $fields);
    }

    public static function exportFieldsForClass($class)
    {
        $singl = singleton($class);
        if ($singl->hasMethod('exportedFields')) {
            return $singl->exportedFields();
        }
        $exportedFields = Config::inst()->get($class, 'exported_fields');

        if (!$exportedFields) {
            $exportedFields = array_keys(self::allFieldsForClass($class));
        }

        $unexportedFields = Config::inst()->get($class, 'unexported_fields');

        if ($unexportedFields) {
{'fraction_non_alphanumeric': 0.13408723747980614, 'fraction_numerical': 0.0, 'mean_word_length': 2.8951781970649897, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1848536', 'n_tokens_mistral': 522, 'n_tokens_neox': 509, 'n_words': 99}