blacksmith-8.x-1.x-dev/src/Blacksmith/EntityImporter/FieldFormatter/ImageFieldFormatter.php

src/Blacksmith/EntityImporter/FieldFormatter/ImageFieldFormatter.php
<?php

namespace Drupal\blacksmith\Blacksmith\EntityImporter\FieldFormatter;

/**
 * Class ImageFieldFormatter.
 *
 * @package Drupal\blacksmith\Blacksmith\EntityImporter\FieldFormatter
 */
class ImageFieldFormatter extends FileFieldFormatter {

  /**
   * {@inheritdoc}
   */
  protected function formatUniqueValue($value) : array {
    $originalValue = $value;
    $value = parent::formatUniqueValue($value);

    if (isset($originalValue['alt'])) {
      $value['alt'] = $originalValue['alt'];
    }

    return $value;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc