You are here

protected function InstallHelper::processFooterPromoBlock in Drupal 9

Same name and namespace in other branches
  1. 8 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processFooterPromoBlock()

Process footer_block data into footer_block block structure.

Parameters

array $data: Data of line that was read from the file.

string $langcode: Current language code.

Return value

array Data structured as a block.

1 call to InstallHelper::processFooterPromoBlock()
InstallHelper::processContent in core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php
Process content into a structure that can be saved into Drupal.

File

core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php, line 638

Class

InstallHelper
Defines a helper class for importing default content.

Namespace

Drupal\demo_umami_content

Code

protected function processFooterPromoBlock(array $data, $langcode) {
  $node_url = $this
    ->getNodePath($langcode, $data['content_type'], $data['node_id']);
  $values = [
    'uuid' => $data['uuid'],
    'info' => $data['info'],
    'type' => $data['type'],
    'langcode' => 'en',
    'field_title' => [
      'value' => $data['field_title'],
    ],
    'field_content_link' => [
      'uri' => 'internal:/' . $node_url,
      'title' => $data['field_content_link_title'],
    ],
    'field_summary' => [
      'value' => $data['field_summary'],
    ],
    'field_media_image' => [
      'target_id' => $this
        ->getMediaImageId($data['image_reference']),
    ],
  ];
  return $values;
}