$definition =
$field_type_manager->
getDefinition($this->
getType());
$this->
addDependency('module',
$definition['provider'
]);
// Plugins can declare additional dependencies in their definition.
if (isset($definition['config_dependencies'
])) { $this->
addDependencies($definition['config_dependencies'
]);
} // Let the field type plugin specify its own dependencies.
// @see \Drupal\Core\Field\FieldItemInterface::calculateDependencies()
$this->
addDependencies($definition['class'
]::
calculateDependencies($this));
// Create dependency on the bundle.
$bundle_config_dependency =
$this->
entityTypeManager()->
getDefinition($this->entity_type
)->
getBundleConfigDependency($this->bundle
);
$this->
addDependency($bundle_config_dependency['type'
],
$bundle_config_dependency['name'
]);
return $this;
} /**
* {@inheritdoc}
*/
public function onDependencyRemoval(array
$dependencies) { $changed = parent::
onDependencyRemoval($dependencies);
$field_type_manager = \Drupal::
service('plugin.manager.field.field_type'
);