/**
  * Transforms Category entity into ES document.
  *
  * @param Category         $category
  * @param CategoryDocument $document
  */
 public function transformCategoryToDocument(Category $category, CategoryDocument $document)
 {
     $document->setId($category->getId());
     $document->setActive($category->isActive());
     $document->setHidden($category->isHidden());
     $document->setLeft($category->getLeft());
     $document->setRight($category->getRight());
     $document->setRootId($category->getRoot()->getId());
     $document->setSort($category->getSort());
     $document->setTitle($category->getTitle());
     $document->setDescription($category->getDesc());
     $document->setLongDescription($category->getLongDesc());
     $document->setAttributes($this->attrToDocService->transform($category->getAttributes()));
     $this->extractUrls($category, $document);
     $parent = $category->getParent();
     $parentId = $parent ? $parent->getId() : null;
     if (empty($parentId) === false) {
         $document->setParentId($parentId);
     } else {
         $document->setParentId('oxrootid');
     }
 }