function appointment_calendar_slot_capacity in Appointment Calendar 8
Same name and namespace in other branches
- 7 appointment_calendar.module \appointment_calendar_slot_capacity()
Implements function to fetch Slot Capacity using selected date.
7 calls to appointment_calendar_slot_capacity()
- AppointmentCalendarEditForm::buildForm in src/
Form/ AppointmentCalendarEditForm.php - Form constructor.
- AppointmentCalendarEditForm::submitForm in src/
Form/ AppointmentCalendarEditForm.php - Form submission handler.
- AppointmentCalendarEditForm::validateForm in src/
Form/ AppointmentCalendarEditForm.php - Form validation handler.
- AppointmentCalendarListForm::buildForm in src/
Form/ AppointmentCalendarListForm.php - Form constructor.
- AppointmentCalendarViewForm::buildForm in src/
Form/ AppointmentCalendarViewForm.php - Form constructor.
File
- ./
appointment_calendar.module, line 173
Code
function appointment_calendar_slot_capacity($selected_date) {
// Fetch Slot capacity.
$db_conn = \Drupal::database();
$slot_query = $db_conn
->select('appointment_date', 'ad');
$slot_query
->fields('ad', [
'slot_capacity',
]);
$slot_query
->condition('date', $selected_date);
$slot_capacity = $slot_query
->execute()
->fetchField();
return $slot_capacity;
}