You are here

abstract class GoogleAnalyticsCounterQueueBase in Google Analytics Counter 8.3

Provides base functionality for Google Analytics Counter workers.

Hierarchy

Expanded class hierarchy of GoogleAnalyticsCounterQueueBase

See also

See https://www.drupal.org/forum/support/module-development-and-code-questio...

https://drupal.stackexchange.com/questions/206838/documentation-or-tutor...

File

src/Plugin/QueueWorker/GoogleAnalyticsCounterQueueBase.php, line 15

Namespace

Drupal\google_analytics_counter\Plugin\QueueWorker
View source
abstract class GoogleAnalyticsCounterQueueBase extends QueueWorkerBase implements ContainerFactoryPluginInterface {

  // Here we don't use the Dependency Injection,
  // but the __construct() and create() methods are necessary.

  /**
   * {@inheritdoc}
   */
  public function __construct() {
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static();
  }

  /**
   * {@inheritdoc}
   */
  public function processItem($data) {
    if ($data['type'] == 'fetch') {
      \Drupal::service('google_analytics_counter.app_manager')
        ->gacUpdatePathCounts($data['index']);
    }
    elseif ($data['type'] == 'count') {
      \Drupal::service('google_analytics_counter.app_manager')
        ->gacUpdateStorage($data['nid'], $data['bundle'], $data['vid']);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GoogleAnalyticsCounterQueueBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
GoogleAnalyticsCounterQueueBase::processItem public function Works on a single queue item. Overrides QueueWorkerInterface::processItem
GoogleAnalyticsCounterQueueBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.