/**
  * 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->documentRegistry->getNodeForDocument($document);
     $this->nodeManager->move($node->getPath(), $event->getDestId(), $event->getDestName());
 }
Example #3
0
 /**
  * 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());
 }