function ArgumentPluginBase::get_plugin

Get the display or row plugin, if it exists.

8 calls to ArgumentPluginBase::get_plugin()
ArgumentPluginBase::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Build the options form.
ArgumentPluginBase::default_argument_form in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Provide a form for selecting the default argument when the default action is set to provide default argument.
ArgumentPluginBase::default_summary_form in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Provide a form for selecting further summary options when the default action is set to display one.
ArgumentPluginBase::get_default_argument in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Get a default argument, if available.
ArgumentPluginBase::process_summary_arguments in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Process the summary arguments for display.

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php, line 1030
Definition of Drupal\views\Plugin\views\argument\ArgumentPluginBase.

Class

ArgumentPluginBase
Base class for arguments.

Namespace

Drupal\views\Plugin\views\argument

Code

function get_plugin($type = 'argument_default', $name = NULL) {
  $options = array();
  switch ($type) {
    case 'argument_default':
      $plugin_name = $this->options['default_argument_type'];
      $options_name = 'default_argument_options';
      break;
    case 'argument_validator':
      $plugin_name = $this->options['validate']['type'];
      $options_name = 'validate_options';
      break;
    case 'style':
      $plugin_name = $this->options['summary']['format'];
      $options_name = 'summary_options';
  }
  if (!$name) {
    $name = $plugin_name;
  }

  // we only fetch the options if we're fetching the plugin actually
  // in use.
  if ($name == $plugin_name) {
    $options = $this->options[$options_name];
  }
  $plugin = drupal_container()
    ->get("plugin.manager.views.{$type}")
    ->createInstance($name);
  if ($plugin) {

    // Style plugins expects different parameters as argument related plugins.
    if ($type == 'style') {
      $plugin
        ->init($this->view, $this->view->display_handler->display, $options);
    }
    else {
      $plugin
        ->init($this->view, $this, $options);
    }
    return $plugin;
  }
}