You are here

class ScheduledPublishCommands in Scheduled Publish 8.2

Same name and namespace in other branches
  1. 8.3 src/Commands/ScheduledPublishCommands.php \Drupal\scheduled_publish\Commands\ScheduledPublishCommands

Class ScheduledPublishCommands

@package Drupal\scheduled_publish\Commands

Hierarchy

Expanded class hierarchy of ScheduledPublishCommands

1 string reference to 'ScheduledPublishCommands'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses ScheduledPublishCommands
scheduled_publish.commands in ./drush.services.yml
\Drupal\scheduled_publish\Commands\ScheduledPublishCommands

File

src/Commands/ScheduledPublishCommands.php, line 13

Namespace

Drupal\scheduled_publish\Commands
View source
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.'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ScheduledPublishCommands::$publishCron private property
ScheduledPublishCommands::doUpdate public function @command scheduled_publish:doUpdate @aliases schp
ScheduledPublishCommands::__construct public function ScheduledPublishCommands constructor.