You are here

function date_repeat_field_bundles in Date 8

Same name and namespace in other branches
  1. 7.3 date_repeat_field/date_repeat_field.module \date_repeat_field_bundles()
  2. 7.2 date_repeat_field/date_repeat_field.module \date_repeat_field_bundles()

Return an array of all entity types and bundles that have repeating date fields.

1 call to date_repeat_field_bundles()
date_repeat_field_menu in date_repeat_field/date_repeat_field.module
Implements hook_menu().

File

date_repeat_field/date_repeat_field.module, line 176
Creates the option of Repeating date fields and manages Date fields that use the Date Repeat API.

Code

function date_repeat_field_bundles() {
  $values = array();
  $fields = field_info_field_map();
  foreach ($fields as $field_name => $value) {
    if (in_array($value['type'], array(
      'date',
    ))) {
      $field = field_info_field($field_name);
      if (date_is_repeat_field($field)) {
        foreach ($value['bundles'] as $entity_type => $bundles) {
          foreach ($bundles as $bundle) {
            $values[$entity_type][$bundle][] = $field_name;
          }
        }
      }
    }
  }
  return $values;
}