You are here

public function RegionMap::generateRegionMap in Layout Plugin Views 8

Same name and namespace in other branches
  1. 8.2 src/RegionMap.php \Drupal\layout_plugin_views\RegionMap::generateRegionMap()

Generates the region map.

1 call to RegionMap::generateRegionMap()
RegionMap::__construct in src/RegionMap.php

File

src/RegionMap.php, line 33

Class

RegionMap

Namespace

Drupal\layout_plugin_views

Code

public function generateRegionMap() {
  $this->map = [];
  foreach ($this->plugin->view->field as $field_name => $field_definition) {
    $region_machine_name = $this
      ->fieldHasValidAssignment($field_name) ? $this->pluginOptions
      ->getAssignedRegion($field_name) : $this->pluginOptions
      ->getDefaultRegion();
    $this->map[$region_machine_name][$field_name] = $field_definition;
  }
}