AnalyticsService
Defines the analytics instance entity.
- Full name:
\Drupal\analytics\Entity\AnalyticsService - Parent class:
ConfigEntityBase - This class implements:
\Drupal\analytics\Entity\AnalyticsServiceInterface,EntityWithPluginCollectionInterface
Properties
id
The analytics instance ID.
protected string $id
label
The analytics instance label.
protected string $label
service
The plugin ID of the service, or NULL until one is chosen.
protected string|null $service
service_configuration
The configuration of the service.
protected array $service_configuration
weight
The weight of the configuration when splitting several folders.
protected int $weight
status
The status, whether to be used by default.
protected bool $status
locked
An indicator whether the service is locked.
protected bool $locked
pluginCollection
The plugin collection that stores the service plugin.
protected \Drupal\analytics\Plugin\ServicePluginCollection|null $pluginCollection
Created on first use, once the service has a plugin ID.
Methods
servicePluginCollection
Encapsulates the creation of the services's LazyPluginCollection.
protected servicePluginCollection(): \Drupal\Component\Plugin\LazyPluginCollection
Return Value:
The service's plugin collection.
getPluginCollections
{@inheritdoc}
public getPluginCollections(): array
getService
Returns the service plugin.
public getService(): \Drupal\analytics\Plugin\ServicePluginInterface
Return Value:
The analytics service plugin used by this analytics service entity.
setService
Sets the service plugin.
public setService(mixed $plugin_id, array $configuration = []): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$plugin_id |
mixed | |
| The service plugin ID. | ||
$configuration |
array | |
| The optional plugin configuration. |
getWeight
Returns the weight for the service.
public getWeight(): int
Return Value:
The service weight.
analyticsServicePluginManager
Gets the analytics service plugin manager.
protected analyticsServicePluginManager(): \Drupal\analytics\AnalyticsServiceManager
Return Value:
The analytics service plugin manager.