You are here

public function CoreViewsContextualFilter::getViewsArgumentDefinition in Core Views Facets 8

Retrieve the argument definition from the current view.

Parameters

string|null $argument_id: The string ID of a argument.

Return value

array|bool An array with the definition of the argument, or FALSE when the plugin doesn't exist.

File

src/Plugin/facets/facet_source/CoreViewsContextualFilter.php, line 214

Class

CoreViewsContextualFilter
Represents a facet source of the core views with contextual filters.

Namespace

Drupal\core_views_facets\Plugin\facets\facet_source

Code

public function getViewsArgumentDefinition($argument_id = NULL) {
  if (empty($argument_id) || empty($this->view)) {
    return FALSE;
  }

  /** @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase $argument */
  $filter = $this->view
    ->getHandler($this->pluginDefinition['view_display'], 'argument', $argument_id);
  return $filter ?: FALSE;
}