You are here

function appointment_calendar_node_delete in Appointment Calendar 8

Implements hook_node_delete().

File

./appointment_calendar.module, line 307

Code

function appointment_calendar_node_delete(Drupal\node\NodeInterface $node) {
  if ($node
    ->getType() == 'appointment_calendar') {
    $query = \Drupal::database()
      ->delete('appointment_slots');
    $query
      ->condition('nid', $node
      ->id());
    $query
      ->execute();
  }
}