You are here

function appointment_calendar_slot_value in Appointment Calendar 8

Same name and namespace in other branches
  1. 7 appointment_calendar.module \appointment_calendar_slot_value()

Implements function to get slot using NID.

1 call to appointment_calendar_slot_value()
appointment_calendar_form_alter in ./appointment_calendar.module
implements hook_form_alter().

File

./appointment_calendar.module, line 211

Code

function appointment_calendar_slot_value($nid) {

  // Get slot value using nid.
  $db_conn = \Drupal::database();
  $slot_query = $db_conn
    ->select('appointment_slots', 'ap');
  $slot_query
    ->fields('ap', [
    'slot',
  ]);
  $slot_query
    ->condition('nid', $nid, '=');
  $slot_result = $slot_query
    ->execute()
    ->fetchField();
  return $slot_result;
}