You are here

public function QueuerCommands::queuerListAvailable in Purge 8.3

List available queuer plugin IDs that can be added.

@usage drush p:queuer-lsa List available plugin IDs for which queuers can be created. @usage drush p:queuer-lsa --format=list Retrieve a simple list of plugin IDs. @usage drush p:queuer-lsa --format=json Export as JSON. @usage drush p:queuer-lsa --format=yaml Export as YAML.

@command p:queuer-lsa @aliases pulsa,p-queuer-lsa @field-labels plugin_id: Plugin label: Label description: Description

Parameters

array $options: Associative array of options whose values come from Drush.

Return value

array|\Consolidation\OutputFormatters\StructuredData\RowsOfFields Row-based structure of data.

File

modules/purge_drush/src/Commands/QueuerCommands.php, line 140

Class

QueuerCommands
Configure Purge queuers from the command line.

Namespace

Drupal\purge_drush\Commands

Code

public function queuerListAvailable(array $options = [
  'format' => 'table',
]) {
  $definitions = $this->purgeQueuers
    ->getPlugins();
  $available = $this->purgeQueuers
    ->getPluginsAvailable();
  $rows = [];
  if ($options['format'] == 'list') {
    foreach ($available as $plugin_id) {
      $rows[] = $plugin_id;
    }
    return $rows;
  }
  else {
    foreach ($available as $plugin_id) {
      $rows[$plugin_id] = [
        'plugin_id' => $plugin_id,
        'label' => (string) $definitions[$plugin_id]['label'],
        'description' => (string) $definitions[$plugin_id]['description'],
      ];
    }
    return new RowsOfFields($rows);
  }
}