You are here

public function WSConnectorSimpleHTTPWithLangReplacement::call in Web Service Data 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/WSConnector/WSConnectorSimpleHTTPWithLangReplacement.php \Drupal\wsdata\Plugin\WSConnector\WSConnectorSimpleHTTPWithLangReplacement::call()

Make the connector call.

Overrides WSConnectorSimpleHTTP::call

File

src/Plugin/WSConnector/WSConnectorSimpleHTTPWithLangReplacement.php, line 98

Class

WSConnectorSimpleHTTPWithLangReplacement
HTTP Connector.

Namespace

Drupal\wsdata\Plugin\WSConnector

Code

public function call($options, $method, $replacements = [], $data = NULL, array $tokens = []) {
  $langcode = $options['langcode'] ?? $this->language_manager
    ->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)
    ->getId();
  $replacements['LANGUAGE'] = $options['lang-' . $langcode] ?? $langcode;
  return parent::call($options, $method, $replacements, $data, $tokens);
}