You are here

function sms_entity_delete in SMS Framework 2.1.x

Same name and namespace in other branches
  1. 8 sms.module \sms_entity_delete()
  2. 2.x sms.module \sms_entity_delete()

Implements hook_entity_delete().

File

./sms.module, line 44
Provides hooks for SMS Framework.

Code

function sms_entity_delete(EntityInterface $entity) {
  if ($entity instanceof ContentEntityInterface) {

    /** @var \Drupal\sms\Provider\PhoneNumberVerificationInterface $phone_number_verification_provider */
    $phone_number_verification_provider = \Drupal::service('sms.phone_number.verification');
    $phone_number_verification_provider
      ->deletePhoneVerificationByEntity($entity);
  }
}