You are here

protected function GatherContentSubProcess::replaceUrls in GatherContent 8.5

Replaces the GC urls to Drupal entity url.

Parameters

mixed $data: String or array containing GC urls.

Return value

array|string Returns the replaced string or array.

1 call to GatherContentSubProcess::replaceUrls()
GatherContentSubProcess::transform in src/Plugin/migrate/process/GatherContentSubProcess.php
Performs the associated process.

File

src/Plugin/migrate/process/GatherContentSubProcess.php, line 94

Class

GatherContentSubProcess
Perform custom value transformation.

Namespace

Drupal\gathercontent\Plugin\migrate\process

Code

protected function replaceUrls($data) {
  if (empty($data)) {
    return $data;
  }
  if (!is_array($data)) {
    return $this
      ->gcUrlToDrupal($data);
  }
  foreach ($data as $key => $value) {
    $data[$key] = $this
      ->gcUrlToDrupal($value);
  }
  return $data;
}