trait ServiceDataTrait in Analytics 8
Hierarchy
- trait \Drupal\analytics\Plugin\ServiceDataTrait
1 file declares its use of ServiceDataTrait
- GoogleTagManager.php in src/
Plugin/ AnalyticsService/ GoogleTagManager.php
File
- src/
Plugin/ ServiceDataTrait.php, line 5
Namespace
Drupal\analytics\PluginView source
trait ServiceDataTrait {
/**
* @return array
*/
public abstract function defaultData();
/**
* @return array
*/
public function getData() {
$data = $this
->defaultData();
$types = [
'analytics_' . $this
->getPluginId() . '_data',
'analytics_' . $this
->getServiceId() . '_data',
];
$this
->moduleHandler()
->alter($types, $data, $this);
return $data;
}
/**
* Wraps the module handler.
*
* @return \Drupal\Core\Extension\ModuleHandlerInterface
* The module handler.
*/
protected abstract function moduleHandler();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServiceDataTrait:: |
abstract public | function | 1 | |
ServiceDataTrait:: |
public | function | ||
ServiceDataTrait:: |
abstract protected | function | Wraps the module handler. |