You are here

public function FieldCollectionSlideshow::field_slideshow_get_fields in Field Slideshow 8

1 call to FieldCollectionSlideshow::field_slideshow_get_fields()
FieldCollectionSlideshow::settingsForm in src/Plugin/Field/FieldFormatter/FieldCollectionSlideshow.php

File

src/Plugin/Field/FieldFormatter/FieldCollectionSlideshow.php, line 611
Contains \Drupal\field_slideshow\Plugin\Field\FieldFormatter\Slideshow.

Class

FieldCollectionSlideshow
Plugin implementation of the 'slideshow' formatter.

Namespace

Drupal\field_slideshow\Plugin\Field\FieldFormatter

Code

public function field_slideshow_get_fields($support_type, $bundle, $field_name) {
  $links = array();
  $map = \Drupal::entityManager()
    ->getFieldMap();
  $map = $map['field_collection_item'];
  $field_machinename = array();
  foreach ($map as $key => $value) {
    if ($value['type'] == $support_type) {
      $field_machinename[$key] = $value['bundles'];
    }
  }
  foreach ($field_machinename as $key => $values) {
    foreach ($values as $innerkey => $innervalue) {
      if ($innerkey == $field_name) {
        $link[$key] = $key;
      }
    }
  }
  return $link;
}