You are here

public function GlExchangeAdapter::getPDConfig in GlobalLink Connect for Drupal 8.2

Same name and namespace in other branches
  1. 8 src/GlExchangeAdapter.php \Drupal\globallink\GlExchangeAdapter::getPDConfig()

Get the PDConfig object.

Parameters

array $settings: Array of settings. Defaults to plugin settings. See getDefaultSettings for info about the expected structure.

Return value

\PDConfig PDConfig object with settings.

File

src/GlExchangeAdapter.php, line 82

Class

GlExchangeAdapter
Provides an interface to the provided library.

Namespace

Drupal\globallink

Code

public function getPDConfig($settings) {
  $settings += $this
    ->getDefaultSettings();
  $pd_config = new \PDConfig();
  $url = strrev($settings['pd_url']);
  if (ord($url) == 47) {
    $url = substr($url, 1);
  }
  $pd_config->url = strrev($url);
  $pd_config->username = $settings['pd_username'];
  $pd_config->password = $settings['pd_password'];
  $pd_config->userAgent = $settings['pd_user_agent'];
  return $pd_config;
}