You are here

function drush_gathercontent_list_mappings in GatherContent 8.3

Same name and namespace in other branches
  1. 8.5 gathercontent.drush.inc \drush_gathercontent_list_mappings()
  2. 8.4 gathercontent.drush.inc \drush_gathercontent_list_mappings()
  3. 7.3 gathercontent.drush.inc \drush_gathercontent_list_mappings()

Implements drush_COMMAND().

File

./gathercontent.drush.inc, line 102
Drush command to cli config import.

Code

function drush_gathercontent_list_mappings() {

  /** @var \Drupal\gathercontent\Entity\MappingInterface[] $gc_mappings */
  $gc_mappings = \Drupal::entityTypeManager()
    ->getStorage('gathercontent_mapping')
    ->loadMultiple();
  $mappings = [];
  foreach ($gc_mappings as $gc_mapping) {
    $mappings[$gc_mapping
      ->id()] = [
      'mapping_id' => $gc_mapping
        ->id(),
      'project_id' => $gc_mapping
        ->getGathercontentProjectId(),
      'project_label' => $gc_mapping
        ->getGathercontentProject(),
      'template_id' => $gc_mapping
        ->getGathercontentTemplateId(),
      'template_label' => $gc_mapping
        ->getGathercontentTemplate(),
      'content_type' => $gc_mapping
        ->getContentType(),
    ];
  }
  return $mappings;
}