function bat_calendar_reference_unit_types_potential_references in Booking and Availability Management Tools for Drupal 7
Parameters
array $field:
array $options:
Return value
array
2 calls to bat_calendar_reference_unit_types_potential_references()
- bat_calendar_reference_autocomplete_unit_type_validate in modules/
bat_calendar_reference/ bat_calendar_reference.module - Validate unit type.
- bat_calendar_reference_unit_types_autocomplete in modules/
bat_calendar_reference/ bat_calendar_reference.module - Menu callback for the unit types autocomplete results.
File
- modules/
bat_calendar_reference/ bat_calendar_reference.module, line 555 - Defines a field type for referencing event information.
Code
function bat_calendar_reference_unit_types_potential_references($field, $options = array()) {
// Fill in default options.
$options += array(
'string' => '',
'match' => 'contains',
'ids' => array(),
'limit' => 0,
);
$results =& drupal_static(__FUNCTION__, array());
// Create unique id for static cache.
$cid = $field['field_name'] . ':' . $options['match'] . ':' . ($options['string'] !== '' ? $options['string'] : implode('-', $options['ids'])) . ':' . $options['limit'];
if (!isset($results[$cid])) {
$references = FALSE;
if ($references === FALSE) {
$references = _bat_calendar_reference_unit_types_potential_references($field, $options);
}
// Store the results.
$results[$cid] = !empty($references) ? $references : array();
}
return $results[$cid];
}