public function RestoreDeriver::getDerivativeDefinitions in Workbench Moderation to Content Moderation 8.2
Gets the definition of all derivatives of a base plugin.
Parameters
array $base_plugin_definition: The definition array of the base plugin.
Return value
array An array of full derivative definitions keyed on derivative id.
Overrides ModerationDeriver::getDerivativeDefinitions
See also
getDerivativeDefinition()
File
- src/
Plugin/ Deriver/ RestoreDeriver.php, line 10
Class
Namespace
Drupal\wbm2cm\Plugin\DeriverCode
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = parent::getDerivativeDefinitions($base_plugin_definition);
foreach ($this->derivatives as $id => &$derivative) {
$keys = $this->entityTypeManager
->getDefinition($id)
->getKeys();
$derivative['source']['plugin'] = "content_entity_revision:{$id}";
foreach ([
'id',
'revision',
'langcode',
] as $key) {
$key = $keys[$key];
$derivative['process'][$key] = $key;
}
$derivative['process']['moderation_state'][0] += [
'source' => [
$keys['id'],
$keys['revision'],
$keys['langcode'],
],
'migration' => [
"wbm2cm_save:{$id}",
],
];
$derivative['destination']['plugin'] = "entity_revision:{$id}";
$derivative['migration_dependencies']['required'][] = "wbm2cm_save:{$id}";
}
return $this->derivatives;
}