當前位置: 首頁>>代碼示例>>PHP>>正文


PHP INode::getId方法代碼示例

本文整理匯總了PHP中Sabre\DAV\INode::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP INode::getId方法的具體用法?PHP INode::getId怎麽用?PHP INode::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sabre\DAV\INode的用法示例。


在下文中一共展示了INode::getId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handleGetProperties

 /**
  * Adds tags and favorites properties to the response,
  * if requested.
  *
  * @param PropFind $propFind
  * @param \Sabre\DAV\INode $node
  * @return void
  */
 public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
 {
     if (!$node instanceof File && !$node instanceof Directory) {
         return;
     }
     $propFind->handle(self::PROPERTY_NAME_COUNT, function () use($node) {
         return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()));
     });
     $propFind->handle(self::PROPERTY_NAME_HREF, function () use($node) {
         return $this->getCommentsLink($node);
     });
     $propFind->handle(self::PROPERTY_NAME_UNREAD, function () use($node) {
         return $this->getUnreadCount($node);
     });
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:23,代碼來源:commentpropertiesplugin.php

示例2: handleGetProperties

 /**
  * Adds tags and favorites properties to the response,
  * if requested.
  *
  * @param PropFind $propFind
  * @param \Sabre\DAV\INode $node
  * @return void
  */
 public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
 {
     if (!$node instanceof \OCA\DAV\Connector\Sabre\Node) {
         return;
     }
     // need prefetch ?
     if ($node instanceof \OCA\DAV\Connector\Sabre\Directory && $propFind->getDepth() !== 0 && (!is_null($propFind->getStatus(self::TAGS_PROPERTYNAME)) || !is_null($propFind->getStatus(self::FAVORITE_PROPERTYNAME)))) {
         // note: pre-fetching only supported for depth <= 1
         $folderContent = $node->getChildren();
         $fileIds[] = (int) $node->getId();
         foreach ($folderContent as $info) {
             $fileIds[] = (int) $info->getId();
         }
         $tags = $this->getTagger()->getTagsForObjects($fileIds);
         if ($tags === false) {
             // the tags API returns false on error...
             $tags = array();
         }
         $this->cachedTags = $this->cachedTags + $tags;
         $emptyFileIds = array_diff($fileIds, array_keys($tags));
         // also cache the ones that were not found
         foreach ($emptyFileIds as $fileId) {
             $this->cachedTags[$fileId] = [];
         }
     }
     $tags = null;
     $isFav = null;
     $propFind->handle(self::TAGS_PROPERTYNAME, function () use($tags, &$isFav, $node) {
         list($tags, $isFav) = $this->getTagsAndFav($node->getId());
         return new TagList($tags);
     });
     $propFind->handle(self::FAVORITE_PROPERTYNAME, function () use($isFav, $node) {
         if (is_null($isFav)) {
             list(, $isFav) = $this->getTagsAndFav($node->getId());
         }
         return $isFav;
     });
 }
開發者ID:kenwi,項目名稱:core,代碼行數:46,代碼來源:tagsplugin.php

示例3: updateProperties

 /**
  * Updates tags and favorites properties, if applicable.
  *
  * @param string $path
  * @param \Sabre\DAV\INode $node
  * @param array $requestedProperties
  * @param array $returnedProperties
  * @return bool success status
  */
 public function updateProperties(array &$properties, array &$result, \Sabre\DAV\INode $node)
 {
     if (!$node instanceof \OC_Connector_Sabre_Node) {
         return;
     }
     $fileId = $node->getId();
     if (isset($properties[self::TAGS_PROPERTYNAME])) {
         $tagsProp = $properties[self::TAGS_PROPERTYNAME];
         unset($properties[self::TAGS_PROPERTYNAME]);
         $this->updateTags($fileId, $tagsProp->getTags());
         $result[200][self::TAGS_PROPERTYNAME] = new TagList($tagsProp->getTags());
     }
     if (isset($properties[self::FAVORITE_PROPERTYNAME])) {
         $favState = $properties[self::FAVORITE_PROPERTYNAME];
         unset($properties[self::FAVORITE_PROPERTYNAME]);
         if ((int) $favState === 1 || $favState === 'true') {
             $favState = true;
             $this->getTagger()->tagAs($fileId, self::TAG_FAVORITE);
         } else {
             $favState = false;
             $this->getTagger()->unTag($fileId, self::TAG_FAVORITE);
         }
         $result[200][self::FAVORITE_PROPERTYNAME] = $favState;
     }
     return true;
 }
開發者ID:heldernl,項目名稱:owncloud8-extended,代碼行數:35,代碼來源:tagsplugin.php

示例4: handleGetProperties

 /**
  * Adds shares to propfind response
  *
  * @param PropFind $propFind propfind object
  * @param \Sabre\DAV\INode $sabreNode sabre node
  */
 public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $sabreNode)
 {
     if (!$sabreNode instanceof \OCA\DAV\Connector\Sabre\Node) {
         return;
     }
     // need prefetch ?
     if ($sabreNode instanceof \OCA\DAV\Connector\Sabre\Directory && $propFind->getDepth() !== 0 && !is_null($propFind->getStatus(self::SHARETYPES_PROPERTYNAME))) {
         $folderNode = $this->userFolder->get($propFind->getPath());
         $children = $folderNode->getDirectoryListing();
         $this->cachedShareTypes[$folderNode->getId()] = $this->getShareTypes($folderNode);
         foreach ($children as $childNode) {
             $this->cachedShareTypes[$childNode->getId()] = $this->getShareTypes($childNode);
         }
     }
     $propFind->handle(self::SHARETYPES_PROPERTYNAME, function () use($sabreNode) {
         if (isset($this->cachedShareTypes[$sabreNode->getId()])) {
             $shareTypes = $this->cachedShareTypes[$sabreNode->getId()];
         } else {
             $node = $this->userFolder->get($sabreNode->getPath());
             $shareTypes = $this->getShareTypes($node);
         }
         return new ShareTypeList($shareTypes);
     });
 }
開發者ID:GitHubUser4234,項目名稱:core,代碼行數:30,代碼來源:SharesPlugin.php


注:本文中的Sabre\DAV\INode::getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。