You are here

public function GoogleAnalyticsReportsApiFeed::__construct in Google Analytics Reports 8.3

Google Analytics Reports Api Feed constructor.

Parameters

string|null $token: The token.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

Drupal\Core\Logger\LoggerChannelFactory $logger_factory: The logger Factory.

Drupal\Core\Cache\CacheFactory $cache_factory: The cache factory.

Symfony\Component\HttpFoundation\RequestStack $request_stack: The request service.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

File

google_analytics_reports_api/src/GoogleAnalyticsReportsApiFeed.php, line 168

Class

GoogleAnalyticsReportsApiFeed
Class GoogleAnalyticsReportsApiFeed.

Namespace

Drupal\google_analytics_reports_api

Code

public function __construct($token = NULL, ModuleHandlerInterface $module_handler = NULL, LoggerChannelFactory $logger_factory = NULL, CacheFactory $cache_factory = NULL, RequestStack $request_stack = NULL, TimeInterface $time = NULL) {
  $this->accessToken = $token;
  if (is_null($module_handler)) {
    $module_handler = \Drupal::service('module_handler');
  }
  $this->moduleHandler = $module_handler;
  if (is_null($logger_factory)) {
    $logger_factory = \Drupal::service('logger.factory');
  }
  $this->loggerFactory = $logger_factory
    ->get('google_analytics_reports_api');
  if (is_null($cache_factory)) {
    $cache_factory = \Drupal::service('cache_factory');
  }
  $this->cacheFactory = $cache_factory;
  if (is_null($request_stack)) {
    $request_stack = \Drupal::service('request_stack');
  }
  $this->requestStack = $request_stack;
  if (is_null($time)) {
    $time = \Drupal::service('datetime.time');
  }
  $this->time = $time;
}