function FieldStorageDefinitionListener::onFieldStorageDefinitionUpdate
Same name in other branches
- 9 core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php \Drupal\Core\Field\FieldStorageDefinitionListener::onFieldStorageDefinitionUpdate()
- 10 core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php \Drupal\Core\Field\FieldStorageDefinitionListener::onFieldStorageDefinitionUpdate()
- 11.x core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php \Drupal\Core\Field\FieldStorageDefinitionListener::onFieldStorageDefinitionUpdate()
Overrides FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionUpdate
File
-
core/
lib/ Drupal/ Core/ Field/ FieldStorageDefinitionListener.php, line 97
Class
- FieldStorageDefinitionListener
- Reacts to field storage definition CRUD on behalf of the Entity system.
Namespace
Drupal\Core\FieldCode
public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
$entity_type_id = $storage_definition->getTargetEntityTypeId();
// @todo Forward this to all interested handlers, not only storage, once
// iterating handlers is possible: https://www.drupal.org/node/2332857.
$storage = $this->entityTypeManager
->getStorage($entity_type_id);
if ($storage instanceof FieldStorageDefinitionListenerInterface) {
$storage->onFieldStorageDefinitionUpdate($storage_definition, $original);
}
$this->entityLastInstalledSchemaRepository
->setLastInstalledFieldStorageDefinition($storage_definition);
$this->eventDispatcher
->dispatch(FieldStorageDefinitionEvents::UPDATE, new FieldStorageDefinitionEvent($storage_definition, $original));
$this->entityFieldManager
->clearCachedFieldDefinitions();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.