You are here

function availability_calendar_get_fields_by_type in Availability Calendars 7.5

Returns all fields of the given type.

Parameters

string $type:

Return value

array An array with field (machine) names.

1 call to availability_calendar_get_fields_by_type()
availability_calendar_get_referring_field in ./availability_calendar.entity.inc
Returns the field name of the field that refers to the given calendar id.

File

./availability_calendar.entity.inc, line 281
Contains Entity API and Search API hooks and callbacks.

Code

function availability_calendar_get_fields_by_type($type) {
  $result = array();
  $fields = field_info_fields();
  foreach ($fields as $field_name => $field) {
    if ($field['type'] === $type && $field['deleted'] == 0) {
      $result[] = $field_name;
    }
  }
  return $result;
}