trait ViewsContextTrait in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 src/ViewsContextTrait.php \Drupal\geolocation\ViewsContextTrait
Trait ViewsContextTrait.
Hierarchy
- trait \Drupal\geolocation\ViewsContextTrait
7 files declare their use of ViewsContextTrait
- FirstRow.php in src/
Plugin/ geolocation/ Location/ FirstRow.php - ViewsBoundaryArgument.php in src/
Plugin/ geolocation/ MapCenter/ ViewsBoundaryArgument.php - ViewsBoundaryArgument.php in src/
Plugin/ geolocation/ Location/ ViewsBoundaryArgument.php - ViewsBoundaryFilter.php in src/
Plugin/ geolocation/ MapCenter/ ViewsBoundaryFilter.php - ViewsEntityArgument.php in src/
Plugin/ geolocation/ Location/ ViewsEntityArgument.php
File
- src/
ViewsContextTrait.php, line 8
Namespace
Drupal\geolocationView source
trait ViewsContextTrait {
/**
* Get display handler from context.
*
* @param mixed $context
* Context.
*
* @return bool|\Drupal\views\Plugin\views\display\DisplayPluginBase
* Display handler or FALSE.
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ViewsContextTrait:: |
protected static | function | Get display handler from context. |