/** * @param \Orm\Zed\Category\Persistence\SpyCategoryNode $node * * @return string */ protected function buildPath(SpyCategoryNode $node) { $pathTokens = $this->categoryQueryContainer->queryPath($node->getIdCategoryNode(), $this->locale->getIdLocale(), false, true)->find(); $formattedPath = []; foreach ($pathTokens as $path) { $formattedPath[] = $path['name']; } return '/' . implode('/', $formattedPath); }
/** * @param int $idNode * @param \Generated\Shared\Transfer\LocaleTransfer $locale * @param bool $excludeRootNode * @param bool $onlyParents * * @return array */ public function getPath($idNode, LocaleTransfer $locale, $excludeRootNode = true, $onlyParents = false) { return $this->queryContainer->queryPath($idNode, $locale->getIdLocale(), $excludeRootNode, $onlyParents)->find(); }