NerdsAndCompany\Schematic\Services\Schematic::importDataModel PHP 메소드

importDataModel() 개인적인 메소드

Import data model.
private importDataModel ( Data $model, boolean $force ) : Result
$model NerdsAndCompany\Schematic\Models\Data
$force boolean if set to true items not in the import will be deleted
리턴 NerdsAndCompany\Schematic\Models\Result
    private function importDataModel(Data $model, $force)
    {
        // Import schema
        $locales = $model->getAttribute('locales', $force);
        $localesImportResult = Craft::app()->schematic_locales->import($locales);
        $plugins = $model->getAttribute('plugins', $force);
        $pluginImportResult = Craft::app()->schematic_plugins->import($plugins);
        $fields = $model->getAttribute('fields');
        $fieldImportResult = Craft::app()->schematic_fields->import($fields, $force);
        $assetSources = $model->getAttribute('assetSources');
        $assetSourcesImportResult = Craft::app()->schematic_assetSources->import($assetSources, $force);
        $globalSets = $model->getAttribute('globalSets');
        $globalSetsImportResult = Craft::app()->schematic_globalSets->import($globalSets, $force);
        $sections = $model->getAttribute('sections');
        $sectionImportResult = Craft::app()->schematic_sections->import($sections, $force);
        $categoryGroups = $model->getAttribute('categoryGroups');
        $categoryGroupImportResult = Craft::app()->schematic_categoryGroups->import($categoryGroups, $force);
        $tagGroups = $model->getAttribute('tagGroups');
        $tagGroupImportResult = Craft::app()->schematic_tagGroups->import($tagGroups, $force);
        $userGroups = $model->getAttribute('userGroups');
        $userGroupImportResult = Craft::app()->schematic_userGroups->import($userGroups, $force);
        $users = $model->getAttribute('users');
        $userImportResult = Craft::app()->schematic_users->import($users, true);
        $fields = $model->getAttribute('fields');
        $fieldImportResultFinal = Craft::app()->schematic_fields->import($fields, $force);
        // Element index settings are supported from Craft 2.5
        if (version_compare(CRAFT_VERSION, '2.5', '>=')) {
            $elementIndexSettingsImportResult = Craft::app()->schematic_elementIndexSettings->import($model->getAttribute('elementIndexSettings'), $force);
        }
        // Verify results
        $result = new Result();
        $result->consume($localesImportResult);
        $result->consume($pluginImportResult);
        $result->consume($fieldImportResult);
        $result->consume($assetSourcesImportResult);
        $result->consume($globalSetsImportResult);
        $result->consume($sectionImportResult);
        $result->consume($categoryGroupImportResult);
        $result->consume($tagGroupImportResult);
        $result->consume($userGroupImportResult);
        $result->consume($userImportResult);
        $result->consume($fieldImportResultFinal);
        // Element index settings are supported from Craft 2.5
        if (version_compare(CRAFT_VERSION, '2.5', '>=')) {
            $result->consume($elementIndexSettingsImportResult);
        }
        $services = Craft::app()->plugins->call('registerMigrationService');
        $this->doImport($result, $model->pluginData, $services, $force);
        return $result;
    }