NerdsAndCompany\Schematic\ConsoleCommands\ImportCommand::actionIndex PHP Метод

actionIndex() публичный Метод

Imports the Craft datamodel.
public actionIndex ( string $file = 'craft/config/schema.yml', string $override_file = 'craft/config/override.yml', boolean $force = false ) : integer
$file string yml file containing the schema definition
$override_file string yml file containing the override values
$force boolean if set to true items not in the import will be deleted
Результат integer
    public function actionIndex($file = 'craft/config/schema.yml', $override_file = 'craft/config/override.yml', $force = false)
    {
        if (!IOHelper::fileExists($file)) {
            $this->usageError(Craft::t('File not found.'));
        }
        $result = Craft::app()->schematic->importFromYaml($file, $override_file, $force);
        if (!$result->hasErrors()) {
            Craft::log(Craft::t('Loaded schema from {file}', ['file' => $file]));
            return 0;
        }
        Craft::log(Craft::t('There was an error loading schema from {file}', ['file' => $file]));
        print_r($result->getErrors());
        return 1;
    }
ImportCommand