You are here

class SqlImportCommand in MongoDB 8.2

Provides the commands.mongodb.storage.import_keyvalue console command.

@DrupalCommand ( extension="mongodb_storage", extensionType="module" )

Hierarchy

  • class \Drupal\mongodb_storage\Command\SqlImportCommand extends \Drupal\Console\Core\Command\ContainerAwareCommand

Expanded class hierarchy of SqlImportCommand

1 string reference to 'SqlImportCommand'
console.services.yml in modules/mongodb_storage/console.services.yml
modules/mongodb_storage/console.services.yml
1 service uses SqlImportCommand
mongodb_storage.command.sql_import in modules/mongodb_storage/console.services.yml
Drupal\mongodb_storage\Command\SqlImportCommand

File

modules/mongodb_storage/src/Command/SqlImportCommand.php, line 22

Namespace

Drupal\mongodb_storage\Command
View source
class SqlImportCommand extends ContainerAwareCommand {

  /**
   * The mongodb.storage.sql_import service.
   *
   * @var \Drupal\mongodb_storage\Install\SqlImport
   */
  protected $sqlImport;

  /**
   * SqlImportCommand constructor.
   *
   * @param \Drupal\mongodb_storage\Install\SqlImport $sqlImport
   *   The mongodb.storage.sql_import service.
   */
  public function __construct(SqlImport $sqlImport) {
    parent::__construct();
    $this->sqlImport = $sqlImport;
  }

  /**
   * {@inheritdoc}
   */
  protected function configure() {
    $name = 'commands.mongodb.storage.import_keyvalue';
    $this
      ->setName('mongodb:storage:import_keyvalue')
      ->setDescription($this
      ->trans("{$name}.description"))
      ->setHelp($this
      ->trans("{$name}.help"))
      ->setAliases([
      'mdbsikv',
      'most-ikv',
    ]);
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    $out = $this->sqlImport
      ->import();
    $this
      ->getIo()
      ->writeln($out);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SqlImportCommand::$sqlImport protected property The mongodb.storage.sql_import service.
SqlImportCommand::configure protected function
SqlImportCommand::execute protected function
SqlImportCommand::__construct public function SqlImportCommand constructor.