PluginManager.php

Definition of Drupal\views\Plugin\Type\PluginManager.

Namespace

Drupal\views\Plugin\Type

File

drupal/core/modules/views/lib/Drupal/views/Plugin/Type/PluginManager.php
View source
<?php

/**
 * @file
 * Definition of Drupal\views\Plugin\Type\PluginManager.
 */
namespace Drupal\views\Plugin\Type;

use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Component\Plugin\Discovery\ProcessDecorator;
use Drupal\Core\Plugin\Discovery\AlterDecorator;
use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
use Drupal\Core\Plugin\Discovery\CacheDecorator;
class PluginManager extends PluginManagerBase {

  /**
   * Constructs a PluginManager object.
   */
  public function __construct($type) {
    $this->discovery = new AnnotatedClassDiscovery('views', $type);
    $this->discovery = new AlterDecorator($this->discovery, 'views_plugins_' . $type);
    $this->discovery = new ProcessDecorator($this->discovery, array(
      $this,
      'processDefinition',
    ));
    $this->discovery = new CacheDecorator($this->discovery, 'views:' . $type, 'views_info');
    $this->factory = new DefaultFactory($this);
    $this->defaults += array(
      'parent' => 'parent',
      'plugin_type' => $type,
      'module' => 'views',
    );
  }

  /**
   * Overrides Drupal\Component\Plugin\PluginManagerBase::processDefinition().
   */
  public function processDefinition(&$definition, $plugin_id) {
    parent::processDefinition($definition, $plugin_id);

    // Setup automatic path/file finding for theme registration.
    if ($definition['module'] == 'views' || isset($definition['theme'])) {
      $definition += array(
        'theme path' => drupal_get_path('module', 'views') . '/theme',
        'theme file' => 'theme.inc',
      );
    }
  }

}

Classes

Namesort descending Description
PluginManager