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


PHP Folder::searchByTag方法代碼示例

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


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

示例1: getFilesByTag

 /**
  * Updates the tags of the specified file path.
  * The passed tags are absolute, which means they will
  * replace the actual tag selection.
  *
  * @param array $tagName tag name to filter by
  * @return FileInfo[] list of matching files
  * @throws \Exception if the tag does not exist
  */
 public function getFilesByTag($tagName)
 {
     $nodes = $this->homeFolder->searchByTag($tagName, $this->userSession->getUser()->getUId());
     foreach ($nodes as &$node) {
         $node = $node->getFileInfo();
     }
     return $nodes;
 }
開發者ID:riso,項目名稱:owncloud-core,代碼行數:17,代碼來源:tagservice.php

示例2: getFilesByTag

 /**
  * Updates the tags of the specified file path.
  * The passed tags are absolute, which means they will
  * replace the actual tag selection.
  *
  * @param array $tagName tag name to filter by
  * @return FileInfo[] list of matching files
  * @throws \Exception if the tag does not exist
  */
 public function getFilesByTag($tagName)
 {
     $nodes = $this->homeFolder->searchByTag($tagName, $this->userSession->getUser()->getUId());
     $fileInfos = [];
     foreach ($nodes as $node) {
         try {
             /** @var \OC\Files\Node\Node $node */
             $fileInfos[] = $node->getFileInfo();
         } catch (\Exception $e) {
             // FIXME Should notify the user, when this happens
             // Can not get FileInfo, maybe the connection to the external
             // storage is interrupted.
         }
     }
     return $fileInfos;
 }
開發者ID:heldernl,項目名稱:owncloud8-extended,代碼行數:25,代碼來源:tagservice.php


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