function SqlContentEntityStorageSchema::hasSharedTableStructureChange

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::hasSharedTableStructureChange()
  2. 8.9.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::hasSharedTableStructureChange()
  3. 11.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::hasSharedTableStructureChange()

Detects whether there is a change in the shared table structure.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The new entity type.

\Drupal\Core\Entity\EntityTypeInterface $original: The origin entity type.

Return value

bool Returns TRUE if either the revisionable or translatable flag changes or a table has been renamed.

3 calls to SqlContentEntityStorageSchema::hasSharedTableStructureChange()
SqlContentEntityStorageSchema::onEntityTypeUpdate in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
SqlContentEntityStorageSchema::requiresEntityDataMigration in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Checks if existing data would be lost if the schema changes were applied.
SqlContentEntityStorageSchema::requiresEntityStorageSchemaChanges in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Checks if the changes to the entity type requires storage schema changes.

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 226

Class

SqlContentEntityStorageSchema
Defines a schema handler that supports revisionable, translatable entities.

Namespace

Drupal\Core\Entity\Sql

Code

protected function hasSharedTableStructureChange(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
    return $entity_type->isRevisionable() != $original->isRevisionable() || $entity_type->isTranslatable() != $original->isTranslatable() || $this->hasSharedTableNameChanges($entity_type, $original);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.