You are here

public function Resource::setPluginDefinition in RESTful 7.2

Sets the plugin definition to the provided array.

Parameters

array $plugin_definition: Definition array to set manually.

Overrides ResourceInterface::setPluginDefinition

File

src/Plugin/resource/Resource.php, line 566
Contains \Drupal\restful\Plugin\resource\Resource.

Class

Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function setPluginDefinition(array $plugin_definition) {
  $this->pluginDefinition = $plugin_definition;
  if (!empty($plugin_definition['dataProvider'])) {
    $this
      ->getDataProvider()
      ->addOptions($plugin_definition['dataProvider']);
  }
}