You are here

public function AcquiaContentHubMappingCommands::contenthubMapping in Acquia Content Hub 8.2

Shows Elastic Search field mappings from Content Hub.

@command acquia:contenthub-mapping @aliases ach-mapping,acquia-contenthub-mapping

Throws

\Exception

File

src/Commands/AcquiaContentHubMappingCommands.php, line 40

Class

AcquiaContentHubMappingCommands
Drush commands for printing Acquia Content Hub mappings.

Namespace

Drupal\acquia_contenthub\Commands

Code

public function contenthubMapping() {
  $client = $this->clientFactory
    ->getClient();
  if (!$client) {
    throw new \Exception(dt('Error trying to connect to the Content Hub. Make sure this site is registered to Content hub.'));
  }
  $output = $client
    ->mapping();
  if ($output) {
    $this
      ->output()
      ->writeln(print_r($output, TRUE));
  }
  else {
    throw new \Exception(dt("Error trying to print the elastic search field mappings."));
  }
}