You are here

class VarbaseUpdateHelperCommands in Varbase Core 8.7

Same name and namespace in other branches
  1. 8.8 modules/varbase_update_helper/src/Commands/VarbaseUpdateHelperCommands.php \Drupal\varbase_update_helper\Commands\VarbaseUpdateHelperCommands
  2. 8.6 modules/varbase_update_helper/src/Commands/VarbaseUpdateHelperCommands.php \Drupal\varbase_update_helper\Commands\VarbaseUpdateHelperCommands
  3. 9.0.x modules/varbase_update_helper/src/Commands/VarbaseUpdateHelperCommands.php \Drupal\varbase_update_helper\Commands\VarbaseUpdateHelperCommands

Class VarbaseUpdateHelperCommands.

Define drush commands for varbase_update_helper module.

@package Drupal\varbase_update_helper\Commands

Hierarchy

Expanded class hierarchy of VarbaseUpdateHelperCommands

1 string reference to 'VarbaseUpdateHelperCommands'
drush.services.yml in modules/varbase_update_helper/drush.services.yml
modules/varbase_update_helper/drush.services.yml
1 service uses VarbaseUpdateHelperCommands
varbase_update_helper.commands in modules/varbase_update_helper/drush.services.yml
Drupal\varbase_update_helper\Commands\VarbaseUpdateHelperCommands

File

modules/varbase_update_helper/src/Commands/VarbaseUpdateHelperCommands.php, line 16

Namespace

Drupal\varbase_update_helper\Commands
View source
class VarbaseUpdateHelperCommands extends DrushCommands {

  /**
   * Command helper object (inspired by search API module)
   *
   * @var \Drupal\varbase_core\Utility\CommandHelper
   */
  protected $commandHelper;

  /**
   * VarbaseUpdateHelperCommands constructor.
   */
  public function __construct() {
    $this->commandHelper = new CommandHelper();
  }

  /**
   * {@inheritdoc}
   */
  public function setLogger(LoggerInterface $logger) {
    parent::setLogger($logger);
    $this->commandHelper
      ->setLogger($logger);
  }

  /**
   * Applying an (optional) update hook (function) from module install file.
   *
   * Apply Varbase updates by invoking the related update hooks.
   *
   * @param string $module
   *   Module name.
   * @param string $update_hook
   *   Update hook.
   * @param array $options
   *   Options.
   *
   * @option force
   *
   * @command varbase_update_helper:varbase-apply-update
   * @aliases varbase-up
   */
  public function varbaseApplyUpdate($module = '', $update_hook = '', array $options = [
    'force' => FALSE,
  ]) {
    $force = $options['force'];
    $this->commandHelper
      ->varbaseApplyUpdate($module, $update_hook, $force);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
VarbaseUpdateHelperCommands::$commandHelper protected property Command helper object (inspired by search API module)
VarbaseUpdateHelperCommands::setLogger public function
VarbaseUpdateHelperCommands::varbaseApplyUpdate public function Applying an (optional) update hook (function) from module install file.
VarbaseUpdateHelperCommands::__construct public function VarbaseUpdateHelperCommands constructor.