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


PHP Tags::getResources方法代码示例

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


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

示例1: processTagSearch

 /**
  * Process a search for a particular tag.
  *
  * @access  private
  * @param   string  $lookfor    The tag to search for
  * @return  array   A revised searchTerms array to get matching Solr records
  *                  (empty if no tag matches found).
  */
 private function processTagSearch($lookfor)
 {
     // Include the app database objects
     require_once ROOT_DIR . '/services/MyResearch/lib/Tags.php';
     require_once ROOT_DIR . '/services/MyResearch/lib/Resource.php';
     // Find our tag in the database
     $tag = new Tags();
     $tag->tag = $lookfor;
     $newSearch = array();
     if ($tag->find(true)) {
         // Grab the list of records tagged with this tag
         $resourceList = $tag->getResources();
         if (count($resourceList)) {
             $newSearch[0] = array('join' => 'OR', 'group' => array());
             foreach ($resourceList as $resource) {
                 $id = $resource->record_id;
                 if ($resource->source == 'eContent') {
                     $id = 'econtentRecord' . $id;
                 }
                 $newSearch[0]['group'][] = array('field' => 'id', 'lookfor' => $id, 'bool' => 'OR');
             }
         }
     }
     return $newSearch;
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:33,代码来源:Solr.php

示例2: _processTagSearch

 /**
  * Process a search for a particular tag.
  *
  * @param string $lookfor The tag to search for
  *
  * @return array          A revised searchTerms array to get matching Solr
  * records (empty if no tag matches found).
  * @access private
  */
 private function _processTagSearch($lookfor)
 {
     // Include the app database objects
     include_once 'services/MyResearch/lib/Tags.php';
     include_once 'services/MyResearch/lib/Resource.php';
     // Find our tag in the database
     $tag = new Tags();
     $tag->tag = $lookfor;
     $tagList = array();
     if ($tag->find(true)) {
         // Grab the list of records tagged with this tag
         $resourceList = array();
         $resourceList = $tag->getResources();
         if (count($resourceList)) {
             foreach ($resourceList as $resource) {
                 $tagList[] = $resource->record_id;
             }
         }
     }
     return $tagList;
 }
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:30,代码来源:Solr.php


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