You are here

protected function TaxonomyTermProcessor::getParentsTerms in Content Synchronizer 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/content_synchronizer/entity_processor/TaxonomyTermProcessor.php \Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor\TaxonomyTermProcessor::getParentsTerms()
  2. 8 src/Plugin/content_synchronizer/entity_processor/TaxonomyTermProcessor.php \Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor\TaxonomyTermProcessor::getParentsTerms()

Return the list of parents terms.

Parameters

\Drupal\taxonomy\Entity\Term $child: The child term.

Return value

mixed The parents terms.

2 calls to TaxonomyTermProcessor::getParentsTerms()
TaxonomyTermProcessor::getDataToExport in src/Plugin/content_synchronizer/entity_processor/TaxonomyTermProcessor.php
Return the data to export.
TaxonomyTermProcessor::onImportedEntity in src/Plugin/content_synchronizer/entity_processor/TaxonomyTermProcessor.php
Action on Entity import end.

File

src/Plugin/content_synchronizer/entity_processor/TaxonomyTermProcessor.php, line 169

Class

TaxonomyTermProcessor
Plugin implementation of the 'accordion' formatter.

Namespace

Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor

Code

protected function getParentsTerms(Term $child) {
  return \Drupal::entityTypeManager()
    ->getStorage($child
    ->getEntityTypeId())
    ->loadParents($child
    ->id());
}