else { // Some updates are always disallowed.
if ($this->entity_type !=
$this->original->entity_type
) { throw new FieldException("Cannot change the entity_type of an existing base field bundle override (entity type:{
$this->entity_type
}, bundle:{
$this->original->bundle
}, field name: {
$this->field_name
})"
);
} if ($this->bundle !=
$this->original->bundle
) { throw new FieldException("Cannot change the bundle of an existing base field bundle override (entity type:{
$this->entity_type
}, bundle:{
$this->original->bundle
}, field name: {
$this->field_name
})"
);
} $previous_definition =
$this->original;
} // Notify the entity storage.
$this->
entityTypeManager()->
getStorage($this->
getTargetEntityTypeId())->
onFieldDefinitionUpdate($this,
$previous_definition);
} /**
* {@inheritdoc}
*/
public static function postDelete(EntityStorageInterface
$storage, array
$field_overrides) { $entity_type_manager = \Drupal::
entityTypeManager();
// Clear the cache upfront, to refresh the results of getBundles().
\Drupal::
service('entity_field.manager'
)->
clearCachedFieldDefinitions();
/** @var \Drupal\Core\Field\Entity\BaseFieldOverride $field_override */
foreach ($field_overrides as $field_override) {