You are here

protected function WSConnectorBase::applyReplacements in Web Service Data 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/WSConnectorBase.php \Drupal\wsdata\Plugin\WSConnectorBase::applyReplacements()

Internal function for applying replacements.

3 calls to WSConnectorBase::applyReplacements()
WSConnectorGraphQL::call in src/Plugin/WSConnector/WSConnectorGraphQL.php
Make the connector call.
WSConnectorLocalFile::call in src/Plugin/WSConnector/WSConnectorLocalFile.php
Make the connector call.
WSConnectorSimpleHTTP::call in src/Plugin/WSConnector/WSConnectorSimpleHTTP.php
Make the connector call.

File

src/Plugin/WSConnectorBase.php, line 203

Class

WSConnectorBase
Base class for Wsconnector plugin plugins.

Namespace

Drupal\wsdata\Plugin

Code

protected function applyReplacements($string, array $replacements = [], array $tokens = []) {
  foreach ($replacements as $token => $replace) {
    $string = str_replace('[' . $token . ']', $replace, $string);
  }
  $string = $this->token
    ->replace($string, $tokens);
  return $string;
}