protected SqlContentEntityStorage::deleteFromDedicatedTables(ContentEntityInterface $entity)
Deletes values of fields in dedicated tables for all revisions.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity.
File
- core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 1293
Class
- SqlContentEntityStorage
- A content entity database storage implementation.
Namespace
Drupal\Core\Entity\Sql
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | protected function deleteFromDedicatedTables(ContentEntityInterface $entity ) { $table_mapping = $this ->getTableMapping(); foreach ( $this ->entityManager->getFieldDefinitions( $entity ->getEntityTypeId(), $entity ->bundle()) as $field_definition ) { $storage_definition = $field_definition ->getFieldStorageDefinition(); if (! $table_mapping ->requiresDedicatedTableStorage( $storage_definition )) { continue ; } $table_name = $table_mapping ->getDedicatedDataTableName( $storage_definition ); $revision_name = $table_mapping ->getDedicatedRevisionTableName( $storage_definition ); $this ->database-> delete ( $table_name ) ->condition( 'entity_id' , $entity ->id()) ->execute(); if ( $this ->entityType->isRevisionable()) { $this ->database-> delete ( $revision_name ) ->condition( 'entity_id' , $entity ->id()) ->execute(); } } } |
Please login to continue.