You are here

public function ConfigSyncCommands::syncListUpdates in Configuration Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Commands/ConfigSyncCommands.php \Drupal\config_sync\Commands\ConfigSyncCommands::syncListUpdates()

Display a list of all extensions with available configuration updates.

@command config-sync-list-updates @usage drush config-sync-list-updates Display a list of all extensions with available configuration updates. @aliases cs-list @field-labels type: Operation type id: Config ID label: Label extension_type: Extension type extension: Extension @default-fields extension,type,label

Return value

\Consolidation\OutputFormatters\StructuredData\RowsOfFields

File

src/Commands/ConfigSyncCommands.php, line 116

Class

ConfigSyncCommands
Drush integration for the Configuration Synchronizer module.

Namespace

Drupal\config_sync\Commands

Code

public function syncListUpdates($options = [
  'format' => 'table',
]) {
  $rows = [];
  foreach ($this->configSyncLister
    ->getExtensionChangelists() as $extension_type => $extensions) {
    foreach ($extensions as $extension_id => $operation_types) {
      foreach ($operation_types as $operation_type => $configurations) {
        foreach ($configurations as $config_id => $config_label) {
          $rows[$config_id] = [
            'type' => $operation_type,
            'id' => $config_id,
            'label' => $config_label,
            'extension_type' => $extension_type,
            'extension' => $extension_id,
          ];
        }
      }
    }
  }
  return new RowsOfFields($rows);
}