/** * @param CopyEvent $event */ public function handleCopy(CopyEvent $event) { $document = $event->getDocument(); $node = $this->documentRegistry->getNodeForDocument($document); $newPath = $this->nodeManager->copy($node->getPath(), $event->getDestId(), $event->getDestName()); $event->setCopiedPath($newPath); }
/** * Sets the workflowstage for the copied node and all its children to test. This is done because newly copied pages * shouldn't be automatically published on the website. * * @param CopyEvent $event */ public function setWorkflowStageToTestForCopy(CopyEvent $event) { $this->setNodeWorkflowStageToTestForCopy($event->getCopiedNode()); }
/** * Copy the routes for all localization of the document in the event. * * @param CopyEvent $event */ public function updateCopiedDocument(CopyEvent $event) { $document = $event->getDocument(); if (!$document instanceof ResourceSegmentBehavior) { return; } $this->updateRoute($this->documentManager->find($event->getCopiedPath(), $this->documentInspector->getLocale($document)), false); }
/** * If a node is copied a node with the same UUID will be created in the live session. * * @param CopyEvent $event */ public function copyNodeInPublicWorkspace(CopyEvent $event) { $this->copyNodeWithChildrenInPublicWorkspace($event->getCopiedNode()); }