当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionInterface::move方法代码示例

本文整理汇总了PHP中PHPCR\SessionInterface::move方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionInterface::move方法的具体用法?PHP SessionInterface::move怎么用?PHP SessionInterface::move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPCR\SessionInterface的用法示例。


在下文中一共展示了SessionInterface::move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: move

 /**
  * Move the document with the given path or ID to the path
  * of the destination document (as a child).
  *
  * @param string $srcId
  * @param string $destId
  * @param string $name
  */
 public function move($srcId, $destId, $name)
 {
     $srcPath = $this->normalizeToPath($srcId);
     $parentDestPath = $this->normalizeToPath($destId);
     $destPath = $parentDestPath . '/' . $name;
     $this->session->move($srcPath, $destPath);
 }
开发者ID:hason,项目名称:sulu-document-manager,代码行数:15,代码来源:NodeManager.php

示例2: doMoveNodes

 private function doMoveNodes(array $nodes, $sourceQuery, $targetPath)
 {
     if (false === $this->isGlobbed($sourceQuery)) {
         return $this->session->move(current($nodes)->getPath(), $targetPath);
     }
     foreach ($nodes as $node) {
         $this->session->move($node->getPath(), $targetPath . '/' . $node->getName());
     }
 }
开发者ID:symfony-cmf,项目名称:resource,代码行数:9,代码来源:PhpcrRepository.php

示例3: produceEvents

 /**
  * Produce the following entries at the end of the event journal:.
  *
  *      PROPERTY_ADDED      /child/jcr:primaryType
  *      NODE_ADDED          /child
  *      PERSIST
  *      PROPERTY_ADDED      /child/prop
  *      PERSIST
  *      PROPERTY_CHANGED    /child/prop
  *      PERSIST
  *      PROPERTY_REMOVED    /child/prop
  *      PERSIST
  *      NODE_REMOVED        /child
  *      PERSIST
  *
  * WARNING:
  * If you change the events (or the order of events) produced here, you
  * will have to adapt self::expectEvents so that it checks for the correct
  * events.
  *
  * @param $session
  */
 protected function produceEvents(SessionInterface $session)
 {
     $parent = $session->getNode($this->nodePath);
     // Will cause a PROPERTY_ADDED + a NODE_ADDED events
     $node = $parent->addNode('child');
     // Will cause a PERSIST event
     $session->save();
     // Will case a PROPERTY_ADDED event
     $prop = $node->setProperty('prop', 'value');
     // Will cause a PERSIST event
     $session->save();
     // Will cause a PROPERTY_CHANGED event
     $prop->setValue('something else');
     // Will cause a PERSIST event
     $session->save();
     // Will cause a PROPERTY_REMOVED event
     $prop->remove();
     // Will cause a PERSIST event
     $session->save();
     // Will cause a NODE_REMOVED + NODE_ADDED + NODE_MOVED events
     $session->move($node->getPath(), $this->nodePath . '/moved');
     // Will cause a PERSIST event
     $session->save();
     // Will cause a NODE_REMOVED event
     $node->remove();
     // Will cause a PERSIST event
     $session->save();
 }
开发者ID:laurentiuc,项目名称:phpcr-api-tests,代码行数:50,代码来源:ObservationManagerTest.php


注:本文中的PHPCR\SessionInterface::move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。