function EntityBlock::getEntityId
Same name in other branches
- 9 core/modules/block/src/Plugin/migrate/destination/EntityBlock.php \Drupal\block\Plugin\migrate\destination\EntityBlock::getEntityId()
- 8.9.x core/modules/block/src/Plugin/migrate/destination/EntityBlock.php \Drupal\block\Plugin\migrate\destination\EntityBlock::getEntityId()
- 10 core/modules/block/src/Plugin/migrate/destination/EntityBlock.php \Drupal\block\Plugin\migrate\destination\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\destinationCode
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.