function get_slot_values in Appointment Calendar 8
Implements to get slots for selected date.
1 call to get_slot_values()
- appointment_calendar_form_alter in ./
appointment_calendar.module - implements hook_form_alter().
File
- ./
appointment_calendar.module, line 199
Code
function get_slot_values($selected_date) {
$db_conn = \Drupal::database();
$slot_query = $db_conn
->select('appointment_date', 'ad');
$slot_query
->fields('ad', [
'slot_capacity',
]);
$slot_query
->condition('date', strtotime(date('Y-m-d', $selected_date)), '=');
$slot_result = $slot_query
->execute()
->fetchField();
return $slot_result;
}