function InstallHelper::processDisclaimerBlock

Same name in other branches
  1. 8.9.x core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processDisclaimerBlock()
  2. 10 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processDisclaimerBlock()
  3. 11.x core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processDisclaimerBlock()

Process disclaimer_block data into disclaimer_block block structure.

Parameters

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

Return value

array Data structured as a block.

1 call to InstallHelper::processDisclaimerBlock()
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 614

Class

InstallHelper
Defines a helper class for importing default content.

Namespace

Drupal\demo_umami_content

Code

protected function processDisclaimerBlock(array $data) {
    $values = [
        'uuid' => $data['uuid'],
        'info' => $data['info'],
        'type' => $data['type'],
        'langcode' => 'en',
        'field_disclaimer' => [
            'value' => $data['field_disclaimer'],
            'format' => 'basic_html',
        ],
        'field_copyright' => [
            'value' => '© ' . date("Y") . ' ' . $data['field_copyright'],
            'format' => 'basic_html',
        ],
    ];
    return $values;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.