public function BlockPluginId::transform in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/block/src/Plugin/migrate/process/BlockPluginId.php \Drupal\block\Plugin\migrate\process\BlockPluginId::transform()
Set the block plugin id.
Overrides ProcessPluginBase::transform
File
- core/
modules/ block/ src/ Plugin/ migrate/ process/ BlockPluginId.php, line 75 - Contains \Drupal\block\Plugin\migrate\process\BlockPluginId.
Class
- BlockPluginId
- Plugin annotation @MigrateProcessPlugin( id = "block_plugin_id" )
Namespace
Drupal\block\Plugin\migrate\processCode
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (is_array($value)) {
list($module, $delta) = $value;
switch ($module) {
case 'aggregator':
list($type, $id) = explode('-', $delta);
if ($type == 'feed') {
return 'aggregator_feed_block';
}
break;
case 'menu':
return "system_menu_block:{$delta}";
case 'block':
if ($this->blockContentStorage) {
$block_id = $this->migrationPlugin
->transform($delta, $migrate_executable, $row, $destination_property);
if ($block_id) {
return 'block_content:' . $this->blockContentStorage
->load($block_id)
->uuid();
}
}
break;
default:
break;
}
}
else {
return $value;
}
}