You are here

protected function ParserBase::prepareVariables in Feeds extensible parsers 8

Prepares the variable map used to substitution.

Parameters

array $expressions: The expressions being parsed.

Return value

array A map of machine name to variable name.

3 calls to ParserBase::prepareVariables()
JmesPathLinesParser::parseItems in src/Feeds/Parser/JmesPathLinesParser.php
Performs the actual parsing.
JsonPathLinesParser::parseItems in src/Feeds/Parser/JsonPathLinesParser.php
Performs the actual parsing.
ParserBase::parseItems in src/Feeds/Parser/ParserBase.php
Performs the actual parsing.

File

src/Feeds/Parser/ParserBase.php, line 332

Class

ParserBase
The Feeds extensible parser.

Namespace

Drupal\feeds_ex\Feeds\Parser

Code

protected function prepareVariables(array $expressions) {
  $variable_map = [];
  foreach ($expressions as $machine_name => $expression) {
    $variable_map[$machine_name] = '$' . $machine_name;
  }
  return $variable_map;
}