class CommandRegistryService in Googalytics - Google Analytics 8
Class CommandRegistryService.
Hierarchy
- class \Drupal\ga\CommandRegistryService
Expanded class hierarchy of CommandRegistryService
1 file declares its use of CommandRegistryService
- DefaultCommandSubscriber.php in src/
EventSubscriber/ DefaultCommandSubscriber.php
1 string reference to 'CommandRegistryService'
1 service uses CommandRegistryService
File
- src/
CommandRegistryService.php, line 10
Namespace
Drupal\gaView source
class CommandRegistryService {
/**
* The registered analytics commands.
*
* @var \Drupal\ga\AnalyticsCommand\DrupalSettingCommandsInterface[]
*/
protected $commands;
/**
* CommandRegistryService constructor.
*/
public function __construct() {
$this->commands = [];
}
/**
* Add a command to the registry.
*
* @param \Drupal\ga\AnalyticsCommand\DrupalSettingCommandsInterface $command
* An analytics command.
*
* @deprecated Use addCommand() instead.
*/
public function addItem(DrupalSettingCommandsInterface $command) {
$this
->addCommand($command);
}
/**
* Add a command to the registry.
*
* @param \Drupal\ga\AnalyticsCommand\DrupalSettingCommandsInterface $command
* An analytics command.
*/
public function addCommand(DrupalSettingCommandsInterface $command) {
$this->commands[] = $command;
}
/**
* Get all commands registered.
*
* @return \Drupal\ga\AnalyticsCommand\DrupalSettingCommandsInterface[]
* The array of registered commands.
*/
public function getCommands() {
return $this->commands;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommandRegistryService:: |
protected | property | The registered analytics commands. | |
CommandRegistryService:: |
public | function | Add a command to the registry. | |
CommandRegistryService:: |
public | function | Add a command to the registry. | |
CommandRegistryService:: |
public | function | Get all commands registered. | |
CommandRegistryService:: |
public | function | CommandRegistryService constructor. |