protected function checkForRoot(AbstractCategory $category)
{
if ($category->getParent() === null) {
try {
$rootNode = $this->container->get($this->service)->getRootNode();
if ($rootNode->getId() != $category->getId()) {
throw new OnlySingleRootNodeAllowedException();
}
} catch (RootNodeNotFoundException $e) {
}
}
}