You are here

function appointment_calendar_slot_value in Appointment Calendar 7

Same name and namespace in other branches
  1. 8 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 422
Adds Appointment calendar filtering and displays Availability.

Code

function appointment_calendar_slot_value($nid) {

  // 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.entity_id', $nid, '=');
  $slot_result = $slot_query
    ->execute()
    ->fetchField();
  return $slot_result;
}