You are here

function appointment_calendar_slot_capacity_value in Appointment Calendar 7

Same name and namespace in other branches
  1. 8 appointment_calendar.module \appointment_calendar_slot_capacity_value()

Implements function to get slot using NID.

2 calls to appointment_calendar_slot_capacity_value()
appointment_calendar_list_date_form in ./appointment_calendar_edit.inc
Implements hook_form().
appointment_calendar_list_date_form_validate in ./appointment_calendar_edit.inc
Implements hook_form_validate().

File

./appointment_calendar.module, line 435
Adds Appointment calendar filtering and displays Availability.

Code

function appointment_calendar_slot_capacity_value($time_slot) {

  // Get slot value using nid.
  $slot_query = db_select('field_data_appointment_slot', 'ad');
  $slot_query
    ->fields('ad', array(
    'appointment_slot_value',
  ));
  $slot_query
    ->condition('ad.bundle', 'appointment_calendar', '=');
  $slot_query
    ->condition('ad.appointment_slot_value', $time_slot, '=');
  $slot_result = $slot_query
    ->execute()
    ->fetchAll();
  return count($slot_result);
}