/** * @param string $categoryName * @param \Generated\Shared\Transfer\LocaleTransfer $locale * * @throws \Spryker\Zed\Category\Business\Exception\MissingCategoryNodeException * * @return int */ public function getCategoryNodeIdentifier($categoryName, LocaleTransfer $locale) { $categoryQuery = $this->queryContainer->queryNodeByCategoryName($categoryName, $locale->getIdLocale()); $categoryNode = $categoryQuery->findOne(); if (!$categoryNode) { throw new MissingCategoryNodeException(sprintf('Tried to retrieve a missing category node for category %s, locale %s', $categoryName, $locale->getLocaleName())); } return $categoryNode->getPrimaryKey(); }