<?php

namespace Drupal\batch\Commands;

use Drush\Commands\DrushCommands;
use Drupal\batch\Batch\ImportSwapi;

/**
 * A Drush command file.
 *
 * @package Drupal\batch\Commands
 */
class BatchCommand extends DrushCommands {
  /**
   * Drush command import from swapi
   *
   * @param string $date
   * @command batch:ImportNodes
   * @aliases import_nodes_batch
   * @usage drush import_nodes_batch $date
   */
  public function ImportNodes($date = null) {
    $import = new ImportSwapi();
    $import->getOperations();
    $import->setBatch();
    drush_backend_batch_process();
  }
}
