class RequirePlugin in Googalytics - Google Analytics 8
Class RequirePlugin.
Since 'require' is a php reserved word, the class name needs to be longer.
Hierarchy
- class \Drupal\ga\AnalyticsCommand\Generic implements DrupalSettingCommandsInterface uses DrupalSettingCommandsTrait- class \Drupal\ga\AnalyticsCommand\RequirePlugin
 
Expanded class hierarchy of RequirePlugin
2 files declare their use of RequirePlugin
- DefaultCommandSubscriber.php in src/EventSubscriber/ DefaultCommandSubscriber.php 
- RequirePluginTest.php in tests/src/ Unit/ AnalyticsCommand/ RequirePluginTest.php 
File
- src/AnalyticsCommand/ RequirePlugin.php, line 10 
Namespace
Drupal\ga\AnalyticsCommandView source
class RequirePlugin extends Generic {
  const DEFAULT_PRIORITY = 250;
  /**
   * The plugin name.
   *
   * @var string
   */
  protected $pluginName;
  /**
   * Create constructor.
   *
   * @param string $plugin_name
   *   The plugin name.
   * @param array $fields_object
   *   A map of values for the command's fieldsObject parameter.
   * @param string $tracker_name
   *   The tracker name (optional).
   * @param int $priority
   *   The command priority.
   */
  public function __construct($plugin_name, array $fields_object = [], $tracker_name = NULL, $priority = self::DEFAULT_PRIORITY) {
    parent::__construct('require', $fields_object, $tracker_name, $priority);
    $this->pluginName = $plugin_name;
  }
  /**
   * {@inheritdoc}
   */
  public function getSettingCommands() {
    $command = [
      ($this->trackerName ? $this->trackerName . '.' : '') . $this->command,
      $this->pluginName,
    ];
    if (!empty($this->fieldsObject)) {
      $command[] = $this->fieldsObject;
    }
    return [
      $command,
    ];
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 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. | |
| RequirePlugin:: | protected | property | The plugin name. | |
| RequirePlugin:: | constant | Overrides Generic:: | ||
| RequirePlugin:: | public | function | An array of commands to be sent to Google Analytics. Overrides Generic:: | |
| RequirePlugin:: | public | function | Create constructor. Overrides Generic:: | 
