You are here

function ip_geoloc_get_field_instances in IP Geolocation Views & Maps 8

Same name and namespace in other branches
  1. 7 views/ip_geoloc_plugin_style.inc \ip_geoloc_get_field_instances()

Implements hook_get_field_instances().

3 calls to ip_geoloc_get_field_instances()
ip_geoloc_plugin_style_bulk_of_form in src/Plugin/views/style/ip_geoloc_plugin_style.inc
The bulk of the plugin style form.
theme_ip_geoloc_plugin_style_differentiator_color_table in src/Plugin/views/style/ip_geoloc_plugin_style.inc
Return HTML for differentiator to color associations table.
_ip_geoloc_plugin_style_diff_color_table_row_form in src/Plugin/views/style/ip_geoloc_plugin_style.inc
Diffs the color table plugin style row.

File

./ip_geoloc.module, line 984
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function ip_geoloc_get_field_instances($field_name) {
  $instances = [];

  // @TODO Check this migration

  /*foreach (field_info_instances() as $type_bundles) {
    foreach ($type_bundles as $bundle_instances) {
    foreach ($bundle_instances as $fld_name => $instance) {
    if ($fld_name == $field_name) {
    $instances[] = $instance;
    }
    }
    }
    }*/
  $entity_bundle_info = \Drupal::service('entity_type.bundle.info');
  $all_bundles = $entity_bundle_info
    ->getAllBundleInfo();
  foreach ($all_bundles as $bundle_type => $type_bundles) {
    foreach ($type_bundles as $fld_name => $instance) {

      //getFieldDefinitions($entity_type_id, $bundle)
      if ($fld_name == $field_name) {
        $instances[] = $instance;
      }
    }
  }
  return $instances;
}