Page MenuHomec4science

NuanceManagementImportWorkflow.php
No OneTemporary

File Metadata

Created
Wed, Mar 12, 13:00

NuanceManagementImportWorkflow.php

<?php
final class NuanceManagementImportWorkflow
extends NuanceManagementWorkflow {
protected function didConstruct() {
$this
->setName('import')
->setExamples('**import** [__options__]')
->setSynopsis(pht('Import data from a source.'))
->setArguments(
array(
array(
'name' => 'source',
'param' => 'source',
'help' => pht('Choose which source to import.'),
),
));
}
public function execute(PhutilArgumentParser $args) {
$source = $this->loadSource($args, 'source');
$definition = $source->getDefinition()
->setViewer($this->getViewer())
->setSource($source);
if (!$definition->hasImportCursors()) {
throw new PhutilArgumentUsageException(
pht(
'This source ("%s") does not expose import cursors.',
$source->getName()));
}
$cursors = $definition->getImportCursors();
if (!$cursors) {
throw new PhutilArgumentUsageException(
pht(
'This source ("%s") does not have any import cursors.',
$source->getName()));
}
echo tsprintf(
"%s\n",
pht('OK, but actual importing is not implemented yet.'));
return 0;
}
}

Event Timeline