Beispiel #1
0
 private function handleSession(SessionInterface $session, $fileName)
 {
     if ($session->getRootNode()->hasNode('cmf')) {
         $session->getNode('/cmf')->remove();
         $session->save();
     }
     $session->importXML('/', $fileName, ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW);
     $session->save();
 }
 /**
  * Imports workspace.
  *
  * @param SessionInterface $session
  * @param string $path
  * @param string $fileName
  */
 private function import(SessionInterface $session, $path, $fileName)
 {
     if ($session->nodeExists($path)) {
         $session->getNode($path)->remove();
         $session->save();
     }
     $session->importXML(PathHelper::getParentPath($path), $fileName, ImportUUIDBehaviorInterface::IMPORT_UUID_COLLISION_THROW);
     $session->save();
 }