You are here

protected function DomStrReplace::getSubject in Migrate Plus 8.5

Same name and namespace in other branches
  1. 8.4 src/Plugin/migrate/process/DomStrReplace.php \Drupal\migrate_plus\Plugin\migrate\process\DomStrReplace::getSubject()

Retrieves the right subject string.

Parameters

\DOMElement $node: The current element from iteration.

Return value

string The string to use a subject on search.

2 calls to DomStrReplace::getSubject()
DomMigrationLookup::transform in src/Plugin/migrate/process/DomMigrationLookup.php
Performs the associated process.
DomStrReplace::transform in src/Plugin/migrate/process/DomStrReplace.php
Performs the associated process.

File

src/Plugin/migrate/process/DomStrReplace.php, line 199

Class

DomStrReplace
String replacements on a source dom.

Namespace

Drupal\migrate_plus\Plugin\migrate\process

Code

protected function getSubject(\DOMElement $node) {
  switch ($this->configuration['mode']) {
    case 'attribute':
      return $node
        ->getAttribute($this->configuration['attribute_options']['name']);
    case 'element':
      return $node->nodeName;
  }
}