You are here

public function AnalyticsService::setService in Analytics 8

Sets the service plugin.

Parameters

string $plugin_id: The service plugin ID.

array $configuration: The optional plugin configuration.

Overrides AnalyticsServiceInterface::setService

File

src/Entity/AnalyticsService.php, line 151

Class

AnalyticsService
Defines the analytics instance entity.

Namespace

Drupal\analytics\Entity

Code

public function setService($plugin_id, array $configuration = []) {
  $this->service = $plugin_id;
  $this->service_configuration = $configuration;
  $this
    ->servicePluginCollection()
    ->addInstanceID($plugin_id, $configuration);
}