public function initCommand($preset, $parts = '')
    {
        $parts = Arrays::trimExplode(',', $parts);
        $presetSettings = $this->loadPreset($preset);
        array_walk($presetSettings['parts'], function ($partSetting, $partName) use ($preset, $parts) {
            $this->outputLine();
            $this->outputPartTitle($partSetting, $partName);

            if ($parts !== array() && !in_array($partName, $parts)) {
                $this->outputLine('<error>~</error> Skipped');
                return;
            }

            if (!isset($partSetting['importerClassName'])) {
                $this->outputLine('<error>Missing importerClassName in the current preset part (%s/%s), check your settings</error>', [$preset, $partName]);
                return;
            }

            $identifier = $partSetting['importerClassName'] . '@' . $preset . '/' . $partName;
            /** @var RecordMapping $recordMapper */
            foreach ($this->recordMapperRepository->findByImporterClassName($identifier) as $recordMapper) {
                $this->recordMapperRepository->remove($recordMapper);
            }
        });
        $vault = new Vault($preset);
        $vault->flush();
    }
public function initCommand($preset, $parts = '')
    {
        $parts = Arrays::trimExplode(',', $parts);
        $presetSettings = $this->loadPreset($preset);
        array_walk($presetSettings['parts'], function ($partSetting, $partName) use ($preset, $parts) {
            $this->outputLine();
            $this->outputPartTitle($partSetting, $partName);

            if ($parts !== array() && !in_array($partName, $parts)) {
                $this->outputLine('<error>~</error> Skipped');
                return;
            }

            if (!isset($partSetting['importerClassName'])) {
                $this->outputLine('<error>Missing importerClassName in the current preset part (%s/%s), check your settings</error>', [$preset, $partName]);
                return;
            }

            $identifier = $partSetting['importerClassName'] . '@' . $preset . '/' . $partName;
            /** @var RecordMapping $recordMapper */
            foreach ($this->recordMapperRepository->findByImporterClassName($identifier) as $recordMapper) {
                $this->recordMapperRepository->remove($recordMapper);
            }
        });
        $vault = new Vault($preset);
        $vault->flush();
    }
public function initCommand ( $ preset , $ parts = '' ) { $ parts = Arrays :: trimExplode ( ',' , $ parts ) ; $ presetSettings = $ this -> loadPreset ( $ preset ) ; array_walk ( $ presetSettings [ 'parts' ] , function ( $ partSetting , $ partName ) use ( $ preset , $ parts ) { $ this -> outputLine ( ) ; $ this -> outputPartTitle ( $ partSetting , $ partName ) ; if ( $ parts !== array ( ) && ! in_array ( $ partName , $ parts ) ) { $ this -> outputLine ( '<error>~</error> Skipped' ) ; return ; } if ( ! isset ( $ partSetting [ 'importerClassName' ] ) ) { $ this -> outputLine ( '<error>Missing importerClassName in the current preset part (%s/%s), check your settings</error>' , [ $ preset , $ partName ] ) ; return ; } $ identifier = $ partSetting [ 'importerClassName' ] . '@' . $ preset . '/' . $ partName ; /** @var RecordMapping $recordMapper */ foreach ( $ this -> recordMapperRepository -> findByImporterClassName ( $ identifier ) as $ recordMapper ) { $ this -> recordMapperRepository -> remove ( $ recordMapper ) ; } } ) ; $ vault = new Vault ( $ preset ) ; $ vault -> flush ( ) ; }
Reset the mapping between external identifier and local nodes

@param string $preset
@param string $parts
Reset the mapping between external identifier and local nodes