You are here

protected function ImporterService::getParentRow in Hierarchical Taxonomy Import 8

This method gives the index of parent row of a term being imported as a taxonomy term.

Parameters

mixed $data: CSV Data as an array.

numeric $parent_row: Taxonomy term's parent offset.

numeric $pointer: Imported term's offset.

Return value

numeric This returns the parent offset after calculations.

1 call to ImporterService::getParentRow()
ImporterService::import in src/services/ImporterService.php

File

src/services/ImporterService.php, line 181

Class

ImporterService
Class ImporterService.

Namespace

Drupal\hierarchical_taxonomy_importer\services

Code

protected function getParentRow($data, $parent_row, $pointer) {

  // Fetching parent row.
  while (empty($data[$parent_row][$pointer - 1]) && $parent_row > 0) {
    $parent_row = $parent_row - 1;
  }
  return $parent_row;
}