comment_entity_predelete

function comment_entity_predelete

comment_entity_predelete(EntityInterface $entity)

Implements hook_entity_predelete().

File

core/modules/comment/comment.module, line 383
Enables users to comment on published content.

Code

function comment_entity_predelete(EntityInterface $entity) {
  // Entities can have non-numeric IDs, but {comment} and
  // {comment_entity_statistics} tables have integer columns for entity ID, and
  // PostgreSQL throws exceptions if you attempt query conditions with
  // mismatched types. So, we need to verify that the ID is numeric (even for an
  // entity type that has an