HandlerPluginManager.php 785 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
<?php

/**
 * @file
 * Definition of Drupal\views\Plugins\Type\HandlerPluginManager.
 */

namespace Drupal\views\Plugins\Type;

use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Component\Plugin\Factory\DefaultFactory;
dawehner's avatar
dawehner committed
12
use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
13
14

class HandlerPluginManager extends PluginManagerBase {
dawehner's avatar
dawehner committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  /**
   * The handler type of this plugin manager, for example filter or field.
   *
   * @var string
   */
  protected $type;

  public function __construct($type) {
    $this->type = $type;

    if (in_array($this->type, array('sort', 'filter', 'relationship', 'field', 'area', 'argument'))) {
      $this->discovery = new AnnotatedClassDiscovery('views', $this->type);
    }
    $this->factory = new DefaultFactory($this->discovery);
29
30
  }
}