You are here

protected function InstallHelper::getNodePath in Drupal 9

Same name and namespace in other branches
  1. 8 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::getNodePath()

Retrieves the node path of node CSV ID saved during the import process.

Parameters

string $langcode: Current language code.

string $content_type: Current content type.

string $node_csv_id: The node's ID from the CSV file.

Return value

string Node path, or 0 if node CSV ID could not be found.

2 calls to InstallHelper::getNodePath()
InstallHelper::processBannerBlock in core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php
Process block_banner data into block_banner block structure.
InstallHelper::processFooterPromoBlock in core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php
Process footer_block data into footer_block block structure.

File

core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php, line 269

Class

InstallHelper
Defines a helper class for importing default content.

Namespace

Drupal\demo_umami_content

Code

protected function getNodePath($langcode, $content_type, $node_csv_id) {
  if (array_key_exists($langcode, $this->nodeIdMap) && array_key_exists($content_type, $this->nodeIdMap[$langcode]) && array_key_exists($node_csv_id, $this->nodeIdMap[$langcode][$content_type])) {
    return $this->nodeIdMap[$langcode][$content_type][$node_csv_id];
  }
  return 0;
}