예제 #1
0
 /**
  * Tests the clearCachedDefinitions() method.
  *
  * @covers ::clearCachedDefinitions
  */
 public function testClearCachedDefinitions()
 {
     $this->entityTypeManager->clearCachedDefinitions()->shouldBeCalled();
     $this->entityTypeRepository->clearCachedDefinitions()->shouldBeCalled();
     $this->entityTypeBundleInfo->clearCachedBundles()->shouldBeCalled();
     $this->entityFieldManager->clearCachedFieldDefinitions()->shouldBeCalled();
     $this->entityManager->clearCachedDefinitions();
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function onBundleDelete($bundle, $entity_type_id)
 {
     $this->entityTypeBundleInfo->clearCachedBundles();
     // Notify the entity storage.
     $storage = $this->entityTypeManager->getStorage($entity_type_id);
     if ($storage instanceof EntityBundleListenerInterface) {
         $storage->onBundleDelete($bundle, $entity_type_id);
     }
     // Invoke hook_entity_bundle_delete() hook.
     $this->moduleHandler->invokeAll('entity_bundle_delete', [$entity_type_id, $bundle]);
     $this->entityFieldManager->clearCachedFieldDefinitions();
 }