You are here

public function QueuerCommands::queuerList in Purge 8.3

List all enabled queuers.

@usage drush p:queuer-ls List all queuers in a table. @usage drush p:queuer-ls --format=list Retrieve a simple list of plugin IDs. @usage drush p:queuer-ls --table=json Export all queuers in JSON. @usage drush p:queuer-ls --table=yaml Export all queuers in YAML.

@command p:queuer-ls @aliases puls,p-queuer-ls @field-labels id: Id 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 95

Class

QueuerCommands
Configure Purge queuers from the command line.

Namespace

Drupal\purge_drush\Commands

Code

public function queuerList(array $options = [
  'format' => 'table',
]) {
  $rows = [];
  if ($options['format'] == 'list') {
    foreach ($this->purgeQueuers as $queuer) {
      $rows[] = $queuer
        ->getPluginId();
    }
    return $rows;
  }
  else {
    foreach ($this->purgeQueuers as $queuer) {
      $rows[] = [
        'id' => (string) $queuer
          ->getPluginId(),
        'label' => (string) $queuer
          ->getLabel(),
        'description' => (string) $queuer
          ->getDescription(),
      ];
    }
    return new RowsOfFields($rows);
  }
}