You are here

protected function EntityBlock::getEntityId in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/block/src/Plugin/migrate/destination/EntityBlock.php \Drupal\block\Plugin\migrate\destination\EntityBlock::getEntityId()

Get the entity id of the row.

Parameters

\Drupal\migrate\Row $row: The row of data.

Return value

string The entity id for the row we're importing.

Overrides Entity::getEntityId

File

core/modules/block/src/Plugin/migrate/destination/EntityBlock.php, line 23
Contains \Drupal\block\Plugin\migrate\destination\EntityBlock.

Class

EntityBlock
Plugin annotation @MigrateDestination( id = "entity:block" )

Namespace

Drupal\block\Plugin\migrate\destination

Code

protected function getEntityId(Row $row) {

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