config = $config; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $container->get('string_translation'), $container->get('config.factory')->get('drupalmoduleupgrader.entity_operations')->get('definitions') ); } /** * {@inheritdoc} */ public function getDerivativeDefinitions($base_definition) { $derivatives = []; foreach ($this->config as $entity_type => $operations) { foreach ($operations as $operation) { $function = $entity_type . '_' . $operation; $variables = [ '@function' => $function, '@operation' => $operation, ]; $derivative = $base_definition; $derivative['function'] = $function; $derivative['method'] = $operation; $derivative['message'] = $this->t('`@function` is now `EntityInterface::@operation`.', $variables); $derivative['description'] = $this->t('Rewrites calls to @function().', $variables); $derivatives[$function] = $derivative; } } return $derivatives; } }