public FieldStorageDefinitionListener::onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition)
Reacts to the creation of a field storage definition.
Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The definition being created.
Overrides FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionCreate
File
- core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php, line 67
Class
- FieldStorageDefinitionListener
- Reacts to field storage definition CRUD on behalf of the Entity system.
Namespace
Drupal\Core\Field
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition ) { $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 ->onFieldStorageDefinitionCreate( $storage_definition ); } $this ->eventDispatcher->dispatch(FieldStorageDefinitionEvents::CREATE, new FieldStorageDefinitionEvent( $storage_definition )); $this ->entityLastInstalledSchemaRepository->setLastInstalledFieldStorageDefinition( $storage_definition ); $this ->entityFieldManager->clearCachedFieldDefinitions(); } |
Please login to continue.