public function ClearDeriver::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 SaveDeriver::getDerivativeDefinitions
See also
getDerivativeDefinition()
File
- src/
Plugin/ Deriver/ ClearDeriver.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) {
$entity_type = $this->entityTypeManager
->getDefinition($id);
$key = $entity_type
->getKey('id');
$derivative['process'][$key] = $key;
if ($entity_type
->isRevisionable()) {
$key = $entity_type
->getKey('revision');
$derivative['process'][$key] = $key;
}
if ($entity_type
->isTranslatable()) {
$key = $entity_type
->getKey('langcode');
$derivative['process'][$key] = $key;
}
$derivative['destination']['plugin'] = "entity_revision:{$id}";
$derivative['migration_dependencies']['required'][] = "wbm2cm_save:{$id}";
}
return $this->derivatives;
}