You are here

ScheduledPublishCommands.php in Scheduled Publish 8.3

Same filename and directory in other branches
  1. 8.2 src/Commands/ScheduledPublishCommands.php

File

src/Commands/ScheduledPublishCommands.php
View source
<?php

namespace Drupal\scheduled_publish\Commands;

use Drupal\scheduled_publish\Service\ScheduledPublishCron;
use Drush\Commands\DrushCommands;

/**
 * Class ScheduledPublishCommands
 *
 * @package Drupal\scheduled_publish\Commands
 */
class ScheduledPublishCommands extends DrushCommands {

  /**
   * @var \Drupal\scheduled_publish\Service\ScheduledPublishCron
   */
  private $publishCron;

  /**
   * ScheduledPublishCommands constructor.
   *
   * @param \Drupal\scheduled_publish\Service\ScheduledPublishCron $publishCron
   */
  public function __construct(ScheduledPublishCron $publishCron) {
    parent::__construct();
    $this->publishCron = $publishCron;
  }

  /**
   * @command scheduled_publish:doUpdate
   * @aliases schp
   */
  public function doUpdate() {
    $this->publishCron
      ->doUpdate();
    $this
      ->logger()
      ->notice(t('Scheduled publish updates done.'));
  }

}

Classes

Namesort descending Description
ScheduledPublishCommands Class ScheduledPublishCommands