public function getTaxonPath($taxonId): ?array
    {
        $taxon = $this->taxonRepository->find($taxonId);
        if (!$taxon instanceof TaxonInterface) {
            return null;
        }

        $parts = [$taxon->getName()];
        while ($taxon->getParent() instanceof TaxonInterface) {
            $taxon = $taxon->getParent();

            $parts[] = $taxon->getName();
        }

        return array_reverse($parts);
    }
public function getTaxonPath($taxonId): ?array
    {
        $taxon = $this->taxonRepository->find($taxonId);
        if (!$taxon instanceof TaxonInterface) {
            return null;
        }

        $parts = [$taxon->getName()];
        while ($taxon->getParent() instanceof TaxonInterface) {
            $taxon = $taxon->getParent();

            $parts[] = $taxon->getName();
        }

        return array_reverse($parts);
    }
public function getTaxonPath ( $ taxonId ) : ? array { $ taxon = $ this -> taxonRepository -> find ( $ taxonId ) ; if ( ! $ taxon instanceof TaxonInterface ) { return null ; } $ parts = [ $ taxon -> getName ( ) ] ; while ( $ taxon -> getParent ( ) instanceof TaxonInterface ) { $ taxon = $ taxon -> getParent ( ) ; $ parts [ ] = $ taxon -> getName ( ) ; } return array_reverse ( $ parts ) ; }
Returns the taxon path.

@param int|string $taxonId

@return array<string|null>|null
Returns the taxon path .