You are here

protected function Importer::getLinkDomain in Default Content Deploy 8

Gets url from file for set to Link manager.

Parameters

array $file:

2 calls to Importer::getLinkDomain()
Importer::import in src/Importer.php
Import to entity.
Importer::preAddToImport in src/Importer.php
Here we can edit data`s value before importing.

File

src/Importer.php, line 345

Class

Importer
A service for handling import of default content.

Namespace

Drupal\default_content_deploy

Code

protected function getLinkDomain($file) {
  $link = $file['data']['_links']['type']['href'];
  $url_data = parse_url($link);
  $host = "{$url_data['scheme']}://{$url_data['host']}";
  return !isset($url_data['port']) ? $host : "{$host}:{$url_data['port']}";
}