You are here

public function DrupalGatherContentClient::setCredentials in GatherContent 8.5

Same name and namespace in other branches
  1. 8.4 src/DrupalGatherContentClient.php \Drupal\gathercontent\DrupalGatherContentClient::setCredentials()

Put the authentication config into client.

1 call to DrupalGatherContentClient::setCredentials()
DrupalGatherContentClient::__construct in src/DrupalGatherContentClient.php

File

src/DrupalGatherContentClient.php, line 26

Class

DrupalGatherContentClient
Extends the GatherContentClient class with Drupal specific functionality.

Namespace

Drupal\gathercontent

Code

public function setCredentials() {
  $config = \Drupal::config('gathercontent.settings');
  $this
    ->setEmail($config
    ->get('gathercontent_username') ?: '');
  $this
    ->setApiKey($config
    ->get('gathercontent_api_key') ?: '');
}