You are here

public function PluginWrapper::get in RESTful 7.2

Gets a field from the plugin configuration.

Parameters

string $key: The key to get.

Return value

mixed The value.

Overrides PluginWrapperInterface::get

File

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

Class

PluginWrapper

Namespace

Drupal\restful\Plugin\resource\DataInterpreter

Code

public function get($key) {

  // If there is a key by that name in the plugin configuration return it, if
  // not then check the plugin definition. If it cannot be found, return NULL.
  $value = isset($this->pluginConfiguration[$key]) ? $this->pluginConfiguration[$key] : NULL;
  return $value ? $value : (isset($this->pluginDefinition[$key]) ? $this->pluginDefinition[$key] : NULL);
}