You are here

PartyDataManager.php in Party 8.2

File

lib/Drupal/party/Plugin/PartyDataManager.php
View source
<?php

/**
 * @file
 * Contains \Drupal\party\Plugin\PartyDataManager.
 */
namespace Drupal\party\Plugin;

use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
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;

/**
 * Plugin type manager for Party Data Plugins.
 */
class PartyDataManager extends PluginManagerBase {

  /**
   * Constructs a PartyDataManager object.
   *
   * @param string $type
   *   The plugin type, for example filter.
   * @param array $namespaces
   *   An array of paths keyed by it's corresponding namespaces.
   */
  public function __construct(array $namespaces = array()) {
    $this->discovery = new AnnotatedClassDiscovery('party', 'PartyData', $namespaces);
    $this->discovery = new ProcessDecorator($this->discovery, array(
      $this,
      'processDefinition',
    ));
    $this->discovery = new AlterDecorator($this->discovery, 'party_data_info');
    $this->discovery = new CacheDecorator($this->discovery, 'party:party_data_info', 'cache');
    $this->factory = new ReflectionFactory($this->discovery);
    $this->defaults += array(
      'singleton' => FALSE,
      'view mode' => 'party',
    );
  }

}

Classes

Namesort descending Description
PartyDataManager Plugin type manager for Party Data Plugins.