You are here

protected static function ViewsContextTrait::getViewsDisplayHandler in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/ViewsContextTrait.php \Drupal\geolocation\ViewsContextTrait::getViewsDisplayHandler()

Get display handler from context.

Parameters

mixed $context: Context.

Return value

bool|\Drupal\views\Plugin\views\display\DisplayPluginBase Display handler or FALSE.

16 calls to ViewsContextTrait::getViewsDisplayHandler()
FirstRow::getAvailableLocationOptions in src/Plugin/geolocation/Location/FirstRow.php
For one Location (i.e. boundary filter), return all options (all filters).
FirstRow::getCoordinates in src/Plugin/geolocation/Location/FirstRow.php
Get map location.
GeometryViewsBoundaryFilter::getAvailableMapCenterOptions in modules/geolocation_geometry/src/Plugin/geolocation/MapCenter/GeometryViewsBoundaryFilter.php
For one MapCenter (i.e. boundary filter), return all options (all filters).
GeometryViewsProximityFilter::getAvailableLocationOptions in modules/geolocation_geometry/src/Plugin/geolocation/Location/GeometryViewsProximityFilter.php
For one Location (i.e. boundary filter), return all options (all filters).
ViewsBoundaryArgument::alterMap in src/Plugin/geolocation/MapCenter/ViewsBoundaryArgument.php
Alter map..

... See full list

File

src/ViewsContextTrait.php, line 19

Class

ViewsContextTrait
Trait ViewsContextTrait.

Namespace

Drupal\geolocation

Code

protected static function getViewsDisplayHandler($context = NULL) {
  if (!is_object($context)) {
    return FALSE;
  }
  if (is_subclass_of($context, 'Drupal\\views\\Plugin\\views\\style\\StylePluginBase')) {

    /** @var \Drupal\views\Plugin\views\display\DisplayPluginBase $context */
    return $context->displayHandler;
  }
  if (is_subclass_of($context, 'Drupal\\views\\Plugin\\views\\HandlerBase')) {

    /** @var \Drupal\views\Plugin\views\display\DisplayPluginBase $context */
    return $context->displayHandler;
  }
  return FALSE;
}