You are here

public function WarmerCommands::list in Warmer 2.x

Same name and namespace in other branches
  1. 8 src/Commands/WarmerCommands.php \Drupal\warmer\Commands\WarmerCommands::list()

List of all available warmer plugins.

@field-labels id: ID label: Label description: Description frequency: Frequency batchSize: Batch Size @default-fields id,label,description,frequency,batchSize

@command warmer:list @aliases warmer-list

Parameters

array $options An associative array of options whose values come from cli, aliases, config, etc.:

Return value

\Consolidation\OutputFormatters\StructuredData\RowsOfFields

File

src/Commands/WarmerCommands.php, line 136

Class

WarmerCommands
Drush commands for the Warmer module.

Namespace

Drupal\warmer\Commands

Code

public function list($options = [
  'format' => 'table',
]) {
  $rows = array_map(function (WarmerPluginBase $warmer) {
    $definition = $warmer
      ->getPluginDefinition();
    return [
      'id' => $warmer
        ->getPluginId(),
      'label' => $definition['label'],
      'description' => $definition['description'],
      'frequency' => $warmer
        ->getFrequency(),
      'batchSize' => $warmer
        ->getBatchSize(),
    ];
  }, $this->warmerManager
    ->getWarmers());
  return new RowsOfFields($rows);
}