ApiTokenManager.php in API Tokens 8.2
File
src/ApiTokenManager.php
View source
<?php
namespace Drupal\api_tokens;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\CategorizingPluginManagerTrait;
use Drupal\Core\Plugin\DefaultPluginManager;
class ApiTokenManager extends DefaultPluginManager implements ApiTokenManagerInterface {
use CategorizingPluginManagerTrait;
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/ApiToken', $namespaces, $module_handler, 'Drupal\\api_tokens\\ApiTokenPluginInterface', 'Drupal\\api_tokens\\Annotation\\ApiToken');
$this
->alterInfo('api_tokens_info');
$this
->setCacheBackend($cache_backend, 'api_tokens_plugins');
}
public function processDefinition(&$definition, $plugin_id) {
parent::processDefinition($definition, $plugin_id);
$this
->processDefinitionCategory($definition);
}
}