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


PHP INode::getShares方法代码示例

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


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

示例1: propFindLate

 /**
  * This method is triggered *after* all properties have been retrieved.
  * This allows us to inject the correct resourcetype for calendars that
  * have been shared.
  *
  * @param DAV\PropFind $propFind
  * @param DAV\INode $node
  * @return void
  */
 function propFindLate(DAV\PropFind $propFind, DAV\INode $node)
 {
     if ($node instanceof IShareableCalendar) {
         if ($rt = $propFind->get('{DAV:}resourcetype')) {
             if (count($node->getShares()) > 0) {
                 $rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared-owner');
             }
         }
         $propFind->handle('{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', function () {
             return new Xml\Property\AllowedSharingModes(true, false);
         });
     }
 }
开发者ID:pageer,项目名称:sabre-dav,代码行数:22,代码来源:SharingPlugin.php

示例2: updateProperties

 /**
  * This method is trigged when a user attempts to update a node's
  * properties.
  *
  * A previous draft of the sharing spec stated that it was possible to use
  * PROPPATCH to remove 'shared-owner' from the resourcetype, thus unsharing
  * the calendar.
  *
  * Even though this is no longer in the current spec, we keep this around
  * because OS X 10.7 may still make use of this feature.
  *
  * @param array $mutations
  * @param array $result
  * @param DAV\INode $node
  * @return void
  */
 public function updateProperties(array &$mutations, array &$result, DAV\INode $node)
 {
     if (!$node instanceof IShareableCalendar) {
         return;
     }
     if (!isset($mutations['{DAV:}resourcetype'])) {
         return;
     }
     // Only doing something if shared-owner is indeed not in the list.
     if ($mutations['{DAV:}resourcetype']->is('{' . Plugin::NS_CALENDARSERVER . '}shared-owner')) {
         return;
     }
     $shares = $node->getShares();
     $remove = array();
     foreach ($shares as $share) {
         $remove[] = $share['href'];
     }
     $node->updateShares(array(), $remove);
     // We're marking this update as 200 OK
     $result[200]['{DAV:}resourcetype'] = null;
     // Removing it from the mutations list
     unset($mutations['{DAV:}resourcetype']);
 }
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:39,代码来源:SharingPlugin.php

示例3: propFind

 /**
  * This event is triggered when properties are requested for a certain
  * node.
  *
  * This allows us to inject any properties early.
  *
  * @param PropFind $propFind
  * @param INode $node
  * @return void
  */
 function propFind(PropFind $propFind, INode $node)
 {
     if ($node instanceof IShareable) {
         $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use($node) {
             return new Invite($node->getShares());
         });
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:18,代码来源:Plugin.php


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