/**
  * Returns the root node for a tree.
  *
  * @throws RootNodeNotFoundException
  *
  * @return AbstractCategory
  */
 public function getRootNode()
 {
     $rootNodes = $this->entityRepository->getRootNodes();
     if (count($rootNodes) == 0) {
         throw new RootNodeNotFoundException();
     }
     $rootNode = reset($rootNodes);
     return $rootNode;
 }