You are here

public function MethodPluginManager::getMethodPlugin in Persistent URL 8

Parameters

string $id:

Return value

MethodInterface

Overrides MethodPluginManagerInterface::getMethodPlugin

File

src/Plugin/MethodPluginManager.php, line 46

Class

MethodPluginManager

Namespace

Drupal\purl\Plugin

Code

public function getMethodPlugin($id) {
  if (!isset($this->methodPlugins[$id])) {
    $plugin = $this
      ->createInstance($id);
    if ($plugin instanceof ContainerAwareInterface) {
      $plugin
        ->setContainer($this->container);
    }
    $this->methodPlugins[$id] = $plugin;
  }
  return $this->methodPlugins[$id];
}