/** * @param MoveEvent $event */ public function handleMove(MoveEvent $event) { $document = $event->getDocument(); $node = $this->documentRegistry->getNodeForDocument($document); $this->nodeManager->move($node->getPath(), $event->getDestId(), $event->getDestName()); }
/** * Moves the routes for all localizations of the document in the event. * * @param MoveEvent $event */ public function updateMovedDocument(MoveEvent $event) { $document = $event->getDocument(); if (!$document instanceof ResourceSegmentBehavior) { return; } $webspaceKey = $this->documentInspector->getWebspace($event->getDocument()); if (!$webspaceKey) { return; } $resourceLocatorStrategy = $this->resourceLocatorStrategyPool->getStrategyByWebspaceKey($webspaceKey); if ($resourceLocatorStrategy->getInputType() !== ResourceLocatorStrategyInterface::INPUT_TYPE_LEAF) { return; } $this->updateRoute($document, true); }
/** * Since moving is not draftable the node will also be moved in the live session immediately. * * @param MoveEvent $event */ public function moveNodeInPublicWorkspace(MoveEvent $event) { $liveNode = $this->getLiveNode($event->getDocument()); $this->nodeHelper->move($liveNode, $event->getDestId(), $event->getDestName()); }
/** * Resolve the destination name on move and copy events. * * @param MoveEvent $event */ private function handleMoveCopy(MoveEvent $event) { $document = $event->getDocument(); if (!$document instanceof AutoNameBehavior) { return; } $destId = $event->getDestId(); $node = $this->registry->getNodeForDocument($document); $destNode = $this->nodeManager->find($destId); $nodeName = $this->resolver->resolveName($destNode, $node->getName()); $event->setDestName($nodeName); }
/** * @param MoveEvent $event */ public function handleMove(MoveEvent $event) { $document = $event->getDocument(); $node = $this->inspector->getNode($event->getDocument()); $this->mapParent($document, $node); }