public function actionIndex(): int
    {
        $this->disableLogging();

        $configurations = [];
        foreach ($this->getDataTypes() as $dataTypeHandle) {
            $dataType = $this->module->getDataType($dataTypeHandle);
            if (null == $dataType) {
                continue;
            }

            $mapper = $dataType->getMapperHandle();
            if (!$this->module->checkMapper($mapper)) {
                continue;
            }

            $records = $dataType->getRecords();
            $configurations[$dataTypeHandle] = $this->module->$mapper->export($records);
        }

        // Load override file.
        $overrideData = [];
        if (file_exists($this->overrideFile)) {
            // Parse data in the overrideFile if available.
            $overrideData = Data::parseYamlFile($this->overrideFile);
        }

        // Export the configuration to a single file.
        if ($this->getStorageType() === self::SINGLE_FILE) {
            $this->exportToSingle($configurations, $overrideData);
        }

        // Export the configuration to multiple yaml files.
        if ($this->getStorageType() === self::MULTIPLE_FILES) {
            $this->exportToMultiple($configurations, $overrideData);
        }

        return 0;
    }
public function actionIndex(): int
    {
        $this->disableLogging();

        $configurations = [];
        foreach ($this->getDataTypes() as $dataTypeHandle) {
            $dataType = $this->module->getDataType($dataTypeHandle);
            if (null == $dataType) {
                continue;
            }

            $mapper = $dataType->getMapperHandle();
            if (!$this->module->checkMapper($mapper)) {
                continue;
            }

            $records = $dataType->getRecords();
            $configurations[$dataTypeHandle] = $this->module->$mapper->export($records);
        }

        // Load override file.
        $overrideData = [];
        if (file_exists($this->overrideFile)) {
            // Parse data in the overrideFile if available.
            $overrideData = Data::parseYamlFile($this->overrideFile);
        }

        // Export the configuration to a single file.
        if ($this->getStorageType() === self::SINGLE_FILE) {
            $this->exportToSingle($configurations, $overrideData);
        }

        // Export the configuration to multiple yaml files.
        if ($this->getStorageType() === self::MULTIPLE_FILES) {
            $this->exportToMultiple($configurations, $overrideData);
        }

        return 0;
    }
public function actionIndex ( ) : int { $ this -> disableLogging ( ) ; $ configurations = [ ] ; foreach ( $ this -> getDataTypes ( ) as $ dataTypeHandle ) { $ dataType = $ this -> module -> getDataType ( $ dataTypeHandle ) ; if ( null == $ dataType ) { continue ; } $ mapper = $ dataType -> getMapperHandle ( ) ; if ( ! $ this -> module -> checkMapper ( $ mapper ) ) { continue ; } $ records = $ dataType -> getRecords ( ) ; $ configurations [ $ dataTypeHandle ] = $ this -> module -> $ mapper -> export ( $ records ) ; } // Load override file. $ overrideData = [ ] ; if ( file_exists ( $ this -> overrideFile ) ) { // Parse data in the overrideFile if available. $ overrideData = Data :: parseYamlFile ( $ this -> overrideFile ) ; } // Export the configuration to a single file. if ( $ this -> getStorageType ( ) === self :: SINGLE_FILE ) { $ this -> exportToSingle ( $ configurations , $ overrideData ) ; } // Export the configuration to multiple yaml files. if ( $ this -> getStorageType ( ) === self :: MULTIPLE_FILES ) { $ this -> exportToMultiple ( $ configurations , $ overrideData ) ; } return 0 ; }
Exports the Craft datamodel.

@return int
@throws \yii\base\ErrorException
Exports the Craft datamodel .