/**
  * {@inheritdoc}
  */
 public function requiresEntityDataMigration(EntityTypeInterface $entity_type, EntityTypeInterface $original)
 {
     // If the original storage has existing entities, or it is impossible to
     // determine if that is the case, require entity data to be migrated.
     $original_storage_class = $original->getStorageClass();
     if (!class_exists($original_storage_class)) {
         return TRUE;
     }
     // Data migration is not needed when only indexes changed, as they can be
     // applied if there is data.
     if (!$this->hasSharedTableStructureChange($entity_type, $original)) {
         return FALSE;
     }
     // Use the original entity type since the storage has not been updated.
     $original_storage = $this->entityManager->createHandlerInstance($original_storage_class, $original);
     return $original_storage->hasData();
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function createHandlerInstance($class, EntityTypeInterface $definition = NULL)
 {
     return $this->entityManager->createHandlerInstance($class, $definition);
 }