class Dimension in Googalytics - Google Analytics 8
Class Dimension.
@package Drupal\ga\AnalyticsCommand
Hierarchy
- class \Drupal\ga\AnalyticsCommand\Generic implements DrupalSettingCommandsInterface uses DrupalSettingCommandsTrait
Expanded class hierarchy of Dimension
2 files declare their use of Dimension
- AnalyticsSubscriber.php in modules/
ga_tokens/ src/ EventSubscriber/ AnalyticsSubscriber.php - DimensionTest.php in tests/
src/ Unit/ AnalyticsCommand/ DimensionTest.php
1 string reference to 'Dimension'
- ga_tokens.schema.yml in modules/
ga_tokens/ config/ schema/ ga_tokens.schema.yml - modules/ga_tokens/config/schema/ga_tokens.schema.yml
File
- src/
AnalyticsCommand/ Dimension.php, line 10
Namespace
Drupal\ga\AnalyticsCommandView source
class Dimension extends Set {
/**
* Dimension constructor.
*
* @param int $index
* The dimension index.
* @param string $value
* The dimension value.
* @param array $fields_object
* A set of additional options for the command.
* @param string $tracker_name
* The tracker name.
* @param int $priority
* The command priority.
*/
public function __construct($index, $value, array $fields_object = [], $tracker_name = NULL, $priority = self::DEFAULT_PRIORITY) {
// TODO remove this cast in favour of typing in PHP7.
if (!is_int($index)) {
if (!is_string($index) || !ctype_digit($index)) {
throw new \InvalidArgumentException("Dimension index must be an integer between 0 and 199");
}
$index = (int) $index;
}
if ($index < 0 || $index >= 200) {
throw new \InvalidArgumentException("Dimension index must be an integer between 0 and 199");
}
parent::__construct('dimension' . $index, $value, $fields_object, $tracker_name, $priority);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Dimension:: |
public | function |
Dimension constructor. Overrides Set:: |
|
DrupalSettingCommandsTrait:: |
protected | property | Priority integer. | |
DrupalSettingCommandsTrait:: |
public | function | An integer value for sorting by priority. | |
Generic:: |
protected | property | The command name. | |
Generic:: |
protected | property | A map of values for the command's fieldsObject parameter. | |
Generic:: |
protected | property | The name of the tracker for this command. | |
Generic:: |
public | function | Get the command name. | |
Generic:: |
public | function | Get the map of values for the command's fieldsObject parameter. | |
Generic:: |
public | function | The tracker this command will be applied to, if specified. | |
Set:: |
protected | property | The setting key. | |
Set:: |
protected | property | The setting value. | |
Set:: |
constant |
Overrides Generic:: |
||
Set:: |
public | function |
An array of commands to be sent to Google Analytics. Overrides Generic:: |
|
Set:: |
public | function | Get the setting key. | |
Set:: |
public | function | Get the setting value. |