You are here

protected static function ViewsContextTrait::getViewsDisplayHandler in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 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.

14 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.
ViewsBoundaryArgument::alterMap in src/Plugin/geolocation/MapCenter/ViewsBoundaryArgument.php
Alter map..
ViewsBoundaryArgument::getAvailableLocationOptions in src/Plugin/geolocation/Location/ViewsBoundaryArgument.php
For one Location (i.e. boundary filter), return all options (all filters).
ViewsBoundaryArgument::getAvailableMapCenterOptions in src/Plugin/geolocation/MapCenter/ViewsBoundaryArgument.php
For one MapCenter (i.e. boundary filter), return all options (all filters).

... 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;
}