You are here

protected function AcquiaContentHubListCommands::decodeEntityArrayMetadata in Acquia Content Hub 8.2

Decodes the base64 'data' element inside a CDF entity 'metadata'.

Parameters

array $cdf_entity: The CDF entity array before it is written to the output.

1 call to AcquiaContentHubListCommands::decodeEntityArrayMetadata()
AcquiaContentHubListCommands::contenthubList in src/Commands/AcquiaContentHubListCommands.php
List entities from the Content Hub using the listEntities() method.

File

src/Commands/AcquiaContentHubListCommands.php, line 157

Class

AcquiaContentHubListCommands
Drush commands for listing entities from Acquia Content Hub.

Namespace

Drupal\acquia_contenthub\Commands

Code

protected function decodeEntityArrayMetadata(array &$cdf_entity) {
  $types = [
    'drupal8_content_entity',
    'drupal8_config_entity',
    'rendered_entity',
  ];
  if (in_array($cdf_entity['type'], $types)) {
    $cdf_entity['metadata']['data'] = base64_decode($cdf_entity['metadata']['data']);
  }
}