You are here

public function ServiceResource::createServicePluginInstance in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/Entity/ServiceResource.php \Drupal\services\Entity\ServiceResource::createServicePluginInstance()

Create service plugin instance.

Parameters

array $values: An array of values to pass into the instance.

Return value

\Drupal\services\ServiceDefinitionInterface A service definition instance.

File

src/Entity/ServiceResource.php, line 157

Class

ServiceResource
Defines service resource entity.

Namespace

Drupal\services\Entity

Code

public function createServicePluginInstance(array $values = []) {
  if (!$this
    ->hasServicePlugin()) {
    return FALSE;
  }
  return $this
    ->serviceDefinition()
    ->createInstance($this->service_plugin_id, $values);
}