You are here

class ImportCompleteCommand in Tome 8

Contains the tome:import-complete command.

@internal

Hierarchy

Expanded class hierarchy of ImportCompleteCommand

1 string reference to 'ImportCompleteCommand'
tome_sync.services.yml in modules/tome_sync/tome_sync.services.yml
modules/tome_sync/tome_sync.services.yml
1 service uses ImportCompleteCommand
tome_sync.import_complete_command in modules/tome_sync/tome_sync.services.yml
Drupal\tome_sync\Commands\ImportCompleteCommand

File

modules/tome_sync/src/Commands/ImportCompleteCommand.php, line 17

Namespace

Drupal\tome_sync\Commands
View source
class ImportCompleteCommand extends CommandBase {

  /**
   * The event dispatcher.
   *
   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
   */
  protected $eventDispatcher;

  /**
   * Constructs an ImportCompleteCommand instance.
   *
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
   *   The event dispatcher.
   */
  public function __construct(EventDispatcherInterface $event_dispatcher) {
    parent::__construct();
    $this->eventDispatcher = $event_dispatcher;
  }

  /**
   * {@inheritdoc}
   */
  protected function configure() {
    $this
      ->setName('tome:import-complete')
      ->setDescription('Triggers an import complete event.')
      ->setHidden(TRUE);
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    $this->eventDispatcher
      ->dispatch(TomeSyncEvents::IMPORT_ALL, new Event());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommandBase::$executable protected property The current executable path.
CommandBase::$io protected property The IO decorator.
CommandBase::initialize protected function
CommandBase::io protected function Returns the IO decorator, for reporting errors. Overrides ProcessTrait::io
ExecutableFinderTrait::findExecutable protected function Finds an executable string for the current process.
ImportCompleteCommand::$eventDispatcher protected property The event dispatcher.
ImportCompleteCommand::configure protected function
ImportCompleteCommand::execute protected function
ImportCompleteCommand::__construct public function Constructs an ImportCompleteCommand instance.
ProcessTrait::displayErrors protected function Displays errors using the IO component.
ProcessTrait::runCommand protected function Runs a single command and outputs errors if encountered.
ProcessTrait::runCommands protected function Runs commands with concurrency.