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


PHP INode::getProperties方法代码示例

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


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

示例1: propFindNode

 /**
  * Fetches properties for a node.
  *
  * This event is called a bit later, so plugins have a chance first to
  * populate the result.
  *
  * @param PropFind $propFind
  * @param INode $node
  * @return void
  */
 function propFindNode(PropFind $propFind, INode $node)
 {
     if ($node instanceof IProperties && ($propertyNames = $propFind->get404Properties())) {
         $nodeProperties = $node->getProperties($propertyNames);
         foreach ($nodeProperties as $propertyName => $value) {
             $propFind->set($propertyName, $value, 200);
         }
     }
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:19,代码来源:CorePlugin.php

示例2: copyNode

 /**
  * copyNode
  *
  * @param INode $source
  * @param ICollection $destinationParent
  * @param string $destinationName
  * @return void
  */
 protected function copyNode(INode $source, ICollection $destinationParent, $destinationName = null)
 {
     if (!$destinationName) {
         $destinationName = $source->getName();
     }
     if ($source instanceof IFile) {
         $data = $source->get();
         // If the body was a string, we need to convert it to a stream
         if (is_string($data)) {
             $stream = fopen('php://temp', 'r+');
             fwrite($stream, $data);
             rewind($stream);
             $data = $stream;
         }
         $destinationParent->createFile($destinationName, $data);
         $destination = $destinationParent->getChild($destinationName);
     } elseif ($source instanceof ICollection) {
         $destinationParent->createDirectory($destinationName);
         $destination = $destinationParent->getChild($destinationName);
         foreach ($source->getChildren() as $child) {
             $this->copyNode($child, $destination);
         }
     }
     if ($source instanceof IProperties && $destination instanceof IProperties) {
         $props = $source->getProperties([]);
         $propPatch = new PropPatch($props);
         $destination->propPatch($propPatch);
         $propPatch->commit();
     }
 }
开发者ID:mattes,项目名称:sabre-dav,代码行数:38,代码来源:Tree.php

示例3: propFindNode

 /**
  * Fetches properties for a node.
  *
  * This event is called a bit later, so plugins have a chance first to
  * populate the result.
  *
  * @param PropFind $propFind
  * @param INode $node
  * @return void
  */
 function propFindNode(PropFind $propFind, INode $node)
 {
     if ($node instanceof IProperties && ($propertyNames = $propFind->get404Properties())) {
         $nodeProperties = $node->getProperties($propertyNames);
         foreach ($propertyNames as $propertyName) {
             if (array_key_exists($propertyName, $nodeProperties)) {
                 $propFind->set($propertyName, $nodeProperties[$propertyName], 200);
             }
         }
     }
 }
开发者ID:drognisep,项目名称:Portfolio-Site,代码行数:21,代码来源:CorePlugin.php


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