You are here

function sms_user_entity_presave in SMS Framework 8

Same name and namespace in other branches
  1. 2.x modules/sms_user/sms_user.module \sms_user_entity_presave()
  2. 2.1.x modules/sms_user/sms_user.module \sms_user_entity_presave()

Implements hook_entity_presave().

File

modules/sms_user/sms_user.module, line 15
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_entity_presave(EntityInterface $entity) {

  // Delay sending SMS message if active hours are enabled.
  if ($entity instanceof SmsMessageEntityInterface) {

    /** @var \Drupal\sms_user\ActiveHoursInterface $active_hours */
    $active_hours = \Drupal::service('sms_user.active_hours');
    $active_hours
      ->delaySmsMessage($entity);
  }
}