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


PHP entryFilter::addSearchMatchToCriteria方法代码示例

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


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

示例1: searchMedia

 /**
 	return array('status' => $status, 'message' => $message, 'objects' => $objects);
 		objects - array of
 				'thumb' 
 				'title'  
 				'description' 
 				'id' - unique id to be passed to getMediaInfo 
 */
 public function searchMedia($media_type, $searchText, $page, $pageSize, $authData = null, $extraData = null)
 {
     $page_size = $pageSize > 20 ? 20 : $pageSize;
     $page--;
     if ($page < 0) {
         $page = 0;
     }
     $status = "ok";
     $message = '';
     $objects = array();
     $should_serach = true;
     if (defined("KALTURA_API_V3")) {
         $kuser = kuserPeer::getKuserByPartnerAndUid(self::$partner_id, self::$puser_id);
         $should_serach = true;
         $kuser_id = $kuser->getId();
     } else {
         $puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid(self::$partner_id, self::$subp_id, self::$puser_id, true);
         if (!$puser_kuser) {
             // very bad - does not exist in system
             $should_serach = false;
         } else {
             $kuser = $puser_kuser->getKuser();
             if (!$kuser) {
                 $should_serach = false;
             } else {
                 $kuser_id = $kuser->getId();
             }
         }
     }
     //		echo "[" . self::$partner_id . "],[".  self::$subp_id . "],[" . self::$puser_id . "],[$kuser_id]";
     if ($should_serach) {
         $c = KalturaCriteria::create(entryPeer::OM_CLASS);
         $c->add(entryPeer::KUSER_ID, $kuser_id);
         $c->add(entryPeer::MEDIA_TYPE, $media_type);
         $c->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
         //			$keywords_array = mySearchUtils::getKeywordsFromStr ( $searchText );
         $filter = new entryFilter();
         $filter->setPartnerSearchScope(self::$partner_id);
         $filter->addSearchMatchToCriteria($c, $searchText, entry::getSearchableColumnName());
         $c->setLimit($pageSize);
         $c->setOffset($page * $pageSize);
         $entry_results = entryPeer::doSelect($c);
         //JoinAll( $c );
         $number_of_results = $c->getRecordsCount();
         $number_of_pages = (int) ($number_of_results / $pageSize);
         if ($number_of_results % $pageSize != 0) {
             $number_of_pages += 1;
         }
         // if there are some left-overs - there must be a nother page
         // add thumbs when not image or video
         $should_add_thumbs = $media_type != entry::ENTRY_MEDIA_TYPE_AUDIO;
         foreach ($entry_results as $entry) {
             // send the id as the url
             $object = array("id" => $entry->getId(), "url" => $entry->getDataUrl(), "tags" => $entry->getTags(), "title" => $entry->getName(), "description" => $entry->getDescription());
             if ($should_add_thumbs) {
                 $object["thumb"] = $entry->getThumbnailUrl();
             }
             $objects[] = $object;
         }
     }
     return array('status' => $status, 'message' => $message, 'objects' => $objects, "needMediaInfo" => self::$NEED_MEDIA_INFO);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:70,代码来源:myKalturaUserClipsServices.class.php


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