Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BlockRegion.php

function BlockRegion::transform

Overrides StaticMap::transform

File

core/modules/block/src/Plugin/migrate/process/BlockRegion.php, line 53

Class

BlockRegion

Namespace

Drupal\block\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    // Set the destination region, based on the source region and theme as well
    // as the current destination default theme.
    [
        $source_theme,
        $destination_theme,
        $region,
    ] = $value;
    // Theme is the same on both source and destination, so ensure that the
    // region exists in the destination theme.
    if (strtolower($source_theme) == strtolower($destination_theme)) {
        if (isset($this->regions[$destination_theme][$region])) {
            return $region;
        }
    }
    // Fall back to static mapping.
    return parent::transform($value, $migrate_executable, $row, $destination_property);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal