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

Breadcrumb

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

function EntityBlock::getEntityId

Overrides Entity::getEntityId

File

core/modules/block/src/Plugin/migrate/destination/EntityBlock.php, line 20

Class

EntityBlock
Migrate destination for block entity.

Namespace

Drupal\block\Plugin\migrate\destination

Code

protected function getEntityId(Row $row) {
    // Try to find the block by its plugin ID and theme.
    $properties = [
        'plugin' => $row->getDestinationProperty('plugin'),
        'theme' => $row->getDestinationProperty('theme'),
    ];
    $blocks = array_keys($this->storage
        ->loadByProperties($properties));
    return reset($blocks);
}

API Navigation

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