Same name and namespace in other branches
- 8.9.x core/modules/block/src/Plugin/migrate/destination/EntityBlock.php \Drupal\block\Plugin\migrate\destination\EntityBlock
- 9 core/modules/block/src/Plugin/migrate/destination/EntityBlock.php \Drupal\block\Plugin\migrate\destination\EntityBlock
Plugin annotation
@MigrateDestination(
id = "entity:block"
)
Hierarchy
- class \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase extends \Drupal\migrate\Plugin\migrate\destination\Entity
- class \Drupal\block\Plugin\migrate\destination\EntityBlock
Expanded class hierarchy of EntityBlock
File
- core/
modules/ block/ src/ Plugin/ migrate/ destination/ EntityBlock.php, line 15
Namespace
Drupal\block\Plugin\migrate\destinationView source
class EntityBlock extends EntityConfigBase {
/**
* {@inheritdoc}
*/
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);
}
/**
* {@inheritdoc}
*/
public function import(Row $row, array $old_destination_id_values = []) {
try {
$entity_ids = parent::import($row, $old_destination_id_values);
} catch (SchemaIncompleteException $e) {
throw new MigrateException($e
->getMessage());
}
return $entity_ids;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityBlock:: |
protected | function | ||
EntityBlock:: |
public | function |
Overrides EntityConfigBase:: |
|
EntityConfigBase:: |
protected | property | The configuration factory. | |
EntityConfigBase:: |
protected | property | The language manager. | |
EntityConfigBase:: |
public static | function | 1 | |
EntityConfigBase:: |
protected | function | Generates an entity ID. | |
EntityConfigBase:: |
public | function | 3 | |
EntityConfigBase:: |
protected | function | Get whether this destination is for translations. | |
EntityConfigBase:: |
public | function | 2 | |
EntityConfigBase:: |
protected | function | Updates an entity with the contents of a row. | 1 |
EntityConfigBase:: |
protected | function | Updates a (possible nested) entity property with a value. | 1 |
EntityConfigBase:: |
public | function | Construct a new entity. | 1 |