You are here

public function CiviEntityStorage::civiPreDelete in CiviCRM Entity 8.3

Allows CiviCRM hook to invoke predelete.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to be deleted.

See also

\Drupal\Core\Entity\EntityStorageInterface::delete

File

src/CiviEntityStorage.php, line 736

Class

CiviEntityStorage
Defines entity class for external CiviCRM entities.

Namespace

Drupal\civicrm_entity

Code

public function civiPreDelete(EntityInterface $entity) {
  if (!empty($entity->drupal_crud)) {
    return;
  }
  CivicrmEntity::preDelete($this, [
    $entity,
  ]);
  $this
    ->invokeHook('predelete', $entity);
}