public function copyAction(Request $request)
    {
        $parentId = $request->get('id');
        $sourceId = $request->get('for_tree_id');
        $prevId = $request->get('prev_id');

        $elementService = $this->get('phlexible_element.element_service');
        $treeManager = $this->get('phlexible_tree.tree_manager');

        $sourceTree = $treeManager->getByNodeId($sourceId);
        $sourceNode = $sourceTree->get($sourceId);

        $targetTree = $treeManager->getByNodeId($parentId);
        $parentNode = $targetTree->get($parentId);
        $prevNode = $targetTree->get($prevId);

        $sourceElement = $elementService->findElement($sourceNode->getTypeId());
        $sourceElementVersion = $elementService->findLatestElementVersion($sourceElement);
        $sourceStructure = $elementService->findElementStructure($sourceElementVersion);

        $targetElement = $elementService->createElement(
            $sourceElementVersion->getElementSource(),
            $sourceElement->getMasterLanguage(),
            $this->getUser()->getId()
        );

        // place new element in element_tree
        $targetNode = $targetTree->create(
            $parentNode,
            $prevNode,
            $sourceNode->getType(),
            $targetElement->getEid(),
            $sourceNode->getAttributes(),
            $this->getUser()->getId(),
            $sourceNode->getSortMode(),
            $sourceNode->getSortDir(),
            $sourceNode->getInNavigation()
        );

        $targetStructure = clone $sourceStructure;
        $targetStructure->setId(null);
        $targetStructure->setDataId(UuidUtil::generate());

        $rii = new \RecursiveIteratorIterator(new ElementStructureIterator($targetStructure->getStructures()), \RecursiveIteratorIterator::SELF_FIRST);
        foreach ($rii as $structure) {
            $structure->setId(null);
            $structure->setDataId(UuidUtil::generate());
        }

        $targetElementVersion = $elementService->createElementVersion(
            $targetElement,
            $targetStructure,
            null,
            $this->getUser()->getId()
        );

        return new ResultResponse(true, 'Element copied.', ['id' => $targetNode->getId()]);
    }