You are here

AnalyticsServiceInterface.php in Analytics 7

File

lib/AnalyticsServiceInterface.php
View source
<?php

interface AnalyticsServiceInterface {

  /**
   * Returns the machine name of the analytics plugin instance.
   *
   * @return string
   */
  public function getMachineName();

  /**
   * Returns the label of the plugin instance.
   *
   * @return string
   */
  public function getLabel();

  /**
   * Returns the description of the plugin instance.
   *
   * @return string
   */
  public function getDescription();

  /**
   * Returns the type of the plugin instance.
   *
   * @return string
   */
  public function getService();

  /**
   *
   * @return array
   */
  public function getConfiguration();

  /**
   * @return array
   */
  public function defaultConfiguration();

  /**
   * Form constructor.
   *
   * @param array $form
   *   An associative array containing the initial structure of the plugin form.
   * @param array $form_state
   *   The current state of the complete form.
   *
   * @return array
   *   The form structure.
   */
  public function buildConfigurationForm($form, &$form_state);

  /**
   * Determines if the current service can track the current request.
   *
   * @param array $context
   *
   * @return bool
   *   TRUE if the service should output on the current page, otherwise FALSE.
   */
  public function canTrack(array $context);

  /**
   * Returns the output of the analytics service.
   *
   * @param array $context
   *
   * @return array
   *   A structured, renderable array.
   */
  public function getOutput(array $context);

  /**
   * @return array
   */
  public function getCacheableUrls();

}

Interfaces