You are here

public function PluginWrapper::__construct in RESTful 7.2

Constructs a PluginWrapper object.

Parameters

PluginInspectionInterface $plugin: The plugin to wrap.

File

src/Plugin/resource/DataInterpreter/PluginWrapper.php, line 42
Contains \Drupal\restful\Plugin\resource\DataInterpreter\PluginWrapper.

Class

PluginWrapper

Namespace

Drupal\restful\Plugin\resource\DataInterpreter

Code

public function __construct(PluginInspectionInterface $plugin) {
  $this->plugin = $plugin;
  $this->pluginDefinition = $plugin
    ->getPluginDefinition();

  // For configurable plugins, expose those properties as well.
  if ($plugin instanceof ConfigurablePluginInterface) {
    $this->pluginConfiguration = $plugin
      ->getConfiguration();
  }
}