You are here

class BrightcoveCommands in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/Commands/BrightcoveCommands.php \Drupal\brightcove\Commands\BrightcoveCommands
  2. 3.x src/Commands/BrightcoveCommands.php \Drupal\brightcove\Commands\BrightcoveCommands

Drush 9.x commands for Brightcove Video Connect.

Hierarchy

  • class \Drupal\brightcove\Commands\BrightcoveCommands extends \Drush\Commands\DrushCommands

Expanded class hierarchy of BrightcoveCommands

1 string reference to 'BrightcoveCommands'
brightcove.drush.services.yml in ./brightcove.drush.services.yml
brightcove.drush.services.yml
1 service uses BrightcoveCommands
brightcove.command in ./brightcove.drush.services.yml
Drupal\brightcove\Commands\BrightcoveCommands

File

src/Commands/BrightcoveCommands.php, line 13

Namespace

Drupal\brightcove\Commands
View source
class BrightcoveCommands extends DrushCommands {

  /**
   * The queue service.
   *
   * @var \Drupal\Core\Queue\QueueFactory
   */
  protected $queueFactory;

  /**
   * BrightcoveCommands constructor.
   *
   * @param \Drupal\Core\Queue\QueueFactory $queueFactory
   *   The queue service.
   */
  public function __construct(QueueFactory $queueFactory) {
    $this->queueFactory = $queueFactory;
  }

  /**
   * Initiates a Brightcove-to-Drupal sync by adding API clients to the queue.
   *
   * @command brightcove:sync-all
   * @aliases brightcove-sync-all,bcsa
   */
  public function syncAll() {
    $this
      ->output()
      ->writeln('Initiating Brightcove-to-Drupal sync...');
    try {
      BrightcoveUtil::runStatusQueues('sync', $this->queueFactory);
      drush_backend_batch_process();
      $this
        ->logger()
        ->notice('Sync complete.');
    } catch (BrightcoveUtilException $e) {
      $this
        ->logger()
        ->error($e
        ->getMessage());
      watchdog_exception('brightcove', $e);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrightcoveCommands::$queueFactory protected property The queue service.
BrightcoveCommands::syncAll public function Initiates a Brightcove-to-Drupal sync by adding API clients to the queue.
BrightcoveCommands::__construct public function BrightcoveCommands constructor.