You are here

public function AssetMetadataHelper::getMetadataAttributeLabels in Media: Acquia DAM 8

Get the available metadata attribute labels.

Return value

array An array of possible metadata attributes keyed by their ID.

File

src/Service/AssetMetadataHelper.php, line 114

Class

AssetMetadataHelper
Class AssetMetadataHelper.

Namespace

Drupal\media_acquiadam\Service

Code

public function getMetadataAttributeLabels() {
  $fields = [
    'colorspace' => $this
      ->t('Color space'),
    'datecaptured' => $this
      ->t('Date captured'),
    'datecreated' => $this
      ->t('Date created'),
    'datemodified' => $this
      ->t('Date modified'),
    'datecaptured_date' => $this
      ->t('Date captured (Date)'),
    'datecreated_date' => $this
      ->t('Date created (Date)'),
    'datemodified_date' => $this
      ->t('Date modified (Date)'),
    'datecaptured_unix' => $this
      ->t('Date captured (Timestamp)'),
    'datecreated_unix' => $this
      ->t('Date created (Timestamp)'),
    'datemodified_unix' => $this
      ->t('Date modified (Timestamp)'),
    'description' => $this
      ->t('Description'),
    'file' => $this
      ->t('File'),
    'filename' => $this
      ->t('Filename'),
    'filesize' => $this
      ->t('Filesize'),
    'filetype' => $this
      ->t('Filetype'),
    'folderID' => $this
      ->t('Folder ID'),
    'height' => $this
      ->t('Height'),
    'status' => $this
      ->t('Active state'),
    'type' => $this
      ->t('Type'),
    'type_id' => $this
      ->t('Type ID'),
    'id' => $this
      ->t('Asset ID'),
    'version' => $this
      ->t('Version'),
    'width' => $this
      ->t('Width'),
  ];

  // Add additional XMP fields to fields array.
  $xmpMetadataFields = $this
    ->getMetadataXmpFields();
  if (!empty($xmpMetadataFields)) {
    foreach ($xmpMetadataFields as $xmp_id => $xmp_field) {
      $fields[$xmp_id] = $xmp_field['label'];
    }
  }
  return $fields;
}