Skip to content

Broken

Fallback for analytics services whose plugin no longer exists.

The service is kept, with its configuration, so it can still be deleted, but it never outputs anything.


See Also:

  • \Drupal\analytics\AnalyticsServiceManager::getFallbackPluginId()

Properties

missingPluginId

The ID of the plugin that is missing.

protected ?string $missingPluginId

Methods

setMissingPluginId

Sets the ID of the plugin that is missing.

public setMissingPluginId(string $plugin_id): void

Parameters:

Parameter Type Description
$plugin_id string
The missing plugin's ID.

getLabel

Returns the label of the analytics service.

public getLabel(): string

Return Value:

The label of this analytics service.


access

{@inheritdoc}

public access(mixed $operation, ?\Drupal\Core\Session\AccountInterface $account = null, mixed $return_as_object = false): mixed

Parameters:

Parameter Type Description
$operation mixed
$account ?\Drupal\Core\Session\AccountInterface
$return_as_object mixed

buildConfigurationForm

{@inheritdoc}

public buildConfigurationForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state): array

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

Inherited methods

setServiceId

Sets the current service config entity ID that is using this plugin.

public setServiceId(mixed $service_id): mixed

Parameters:

Parameter Type Description
$service_id mixed
The service config entity ID.

getServiceId

Gets the current service config entity ID that is using this plugin.

public getServiceId(): string

Return Value:

The service config entity ID.


__construct

{@inheritdoc}

public __construct(array $configuration, mixed $plugin_id, mixed $plugin_definition): mixed

Parameters:

Parameter Type Description
$configuration array
$plugin_id mixed
$plugin_definition mixed

create

{@inheritdoc}

public static create(\Symfony\Component\DependencyInjection\ContainerInterface $container, array $configuration, mixed $plugin_id, mixed $plugin_definition): static
  • This method is static. Parameters:
Parameter Type Description
$container \Symfony\Component\DependencyInjection\ContainerInterface
$configuration array
$plugin_id mixed
$plugin_definition mixed

getLabel

Returns the label of the analytics service.

public getLabel(): string

Return Value:

The label of this analytics service.


access

{@inheritdoc}

public access(mixed $operation, ?\Drupal\Core\Session\AccountInterface $account = null, mixed $return_as_object = false): mixed

Parameters:

Parameter Type Description
$operation mixed
$account ?\Drupal\Core\Session\AccountInterface
$return_as_object mixed

hasMultipleInstances

Checks whether more than one analytics service uses this plugin.

public hasMultipleInstances(): bool

Return Value:

TRUE if two or more analytics services use this plugin.


getOutput

Returns the output of the analytics service.

public getOutput(): array

Return Value:

A structured, renderable array.


getCspSources

Gets the Content Security Policy sources the service's output needs.

public getCspSources(): array<string,string[]>

Return Value:

URLs keyed by directive, such as ['script-src' => ['https://gc.zgo.at']].


getCacheableUrls

Gets the URLs of the service's external files to cache locally.

public getCacheableUrls(): array

Return Value:

A list of URLs.


getCacheContexts

{@inheritdoc}

public getCacheContexts(): array

The output's cacheability. Plugins that vary their output by something other than their configuration add it here.


getCacheTags

{@inheritdoc}

public getCacheTags(): array

getCacheMaxAge

{@inheritdoc}

public getCacheMaxAge(): int

setConfiguration

{@inheritdoc}

public setConfiguration(array $configuration): mixed

Parameters:

Parameter Type Description
$configuration array

getConfiguration

{@inheritdoc}

public getConfiguration(): array

defaultConfiguration

{@inheritdoc}

public defaultConfiguration(): array

buildConfigurationForm

{@inheritdoc}

public buildConfigurationForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state): array

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

validateConfigurationForm

{@inheritdoc}

public validateConfigurationForm(array& $form, \Drupal\Core\Form\FormStateInterface $form_state): mixed

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

submitConfigurationForm

{@inheritdoc}

public submitConfigurationForm(array& $form, \Drupal\Core\Form\FormStateInterface $form_state): mixed

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

calculateDependencies

{@inheritdoc}

public calculateDependencies(): array