class ImportContentCommand in Tome 8
Contains the tome:import-content command.
@internal
Hierarchy
- class \Drupal\tome_base\CommandBase extends \Symfony\Component\Console\Command\Command uses ExecutableFinderTrait, ProcessTrait
- class \Drupal\tome_sync\Commands\ImportCommand
- class \Drupal\tome_sync\Commands\ImportContentCommand
- class \Drupal\tome_sync\Commands\ImportCommand
Expanded class hierarchy of ImportContentCommand
1 string reference to 'ImportContentCommand'
- tome_sync.services.yml in modules/
tome_sync/ tome_sync.services.yml - modules/tome_sync/tome_sync.services.yml
1 service uses ImportContentCommand
File
- modules/
tome_sync/ src/ Commands/ ImportContentCommand.php, line 15
Namespace
Drupal\tome_sync\CommandsView source
class ImportContentCommand extends ImportCommand {
/**
* {@inheritdoc}
*/
protected function configure() {
$this
->setName('tome:import-content')
->setDescription('Imports given content.')
->addArgument('names', InputArgument::REQUIRED, 'A comma separated list of IDs in the format entity_type_id:uuid:langcode.');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
$names = $input
->getArgument('names');
$names = explode(',', $names);
foreach ($names as $name) {
list($entity_type_id, $uuid, $langcode) = TomeSyncHelper::getPartsFromContentName($name);
$this->importer
->importContent($entity_type_id, $uuid, $langcode);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommandBase:: |
protected | property | The current executable path. | |
CommandBase:: |
protected | property | The IO decorator. | |
CommandBase:: |
protected | function | ||
CommandBase:: |
protected | function |
Returns the IO decorator, for reporting errors. Overrides ProcessTrait:: |
|
ExecutableFinderTrait:: |
protected | function | Finds an executable string for the current process. | |
ImportCommand:: |
protected | property | The entity type manager. | |
ImportCommand:: |
protected | property | The importer. | |
ImportCommand:: |
protected | property | The state system. | |
ImportCommand:: |
protected | function | Checks the importing state and prompts the user if applicable. | |
ImportCommand:: |
protected | function | Deletes content using sub-processes. | |
ImportCommand:: |
constant | The default number of entities to import in each process. | ||
ImportCommand:: |
protected | function | Imports chunks of content using sub-processes. | |
ImportCommand:: |
protected | function | Prepares config for import by copying some directly from the source. | |
ImportCommand:: |
constant | The default number of processes to invoke. | ||
ImportCommand:: |
public | function | Constructs an ImportCommand instance. | 2 |
ImportContentCommand:: |
protected | function |
Overrides ImportCommand:: |
|
ImportContentCommand:: |
protected | function |
Overrides ImportCommand:: |
|
ProcessTrait:: |
protected | function | Displays errors using the IO component. | |
ProcessTrait:: |
protected | function | Runs a single command and outputs errors if encountered. | |
ProcessTrait:: |
protected | function | Runs commands with concurrency. |