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


PHP kshowPeer::getCriteriaFilter方法代码示例

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


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

示例1: array

 /**
 	return array('status' => $status, 'message' => $message, 'objects' => $objects);
 		objects - array of
 				'thumb' 
 				'title'  
 				'description' 
 				'id' - unique id to be passed to getMediaInfo 
 
 	this service will first return the relevant kshows, then find the relevant roughcuts and finally fetch the entries
 */
 public function searchMedia($media_type, $searchText, $page, $pageSize, $authData = null, $extraData = null)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     // this bellow will bypass the partner filter - at the end of the code the filter will return to be as was before
     $kshow_criteria = kshowPeer::getCriteriaFilter()->getFilter();
     $original_kshow_partner_to_filter = $kshow_criteria->get(kshowPeer::PARTNER_ID);
     $kshow_criteria->remove(kshowPeer::PARTNER_ID);
     $entry_criteria = entryPeer::getCriteriaFilter()->getFilter();
     $original_entry_partner_to_filter = $entry_criteria->get(entryPeer::PARTNER_ID);
     $entry_criteria->remove(entryPeer::PARTNER_ID);
     $page_size = $pageSize > self::MAX_PAGE_SIZE ? self::MAX_PAGE_SIZE : $pageSize;
     $status = "ok";
     $message = '';
     $kshow_filter = $this->getKshowFilter($extraData);
     $limit = $pageSize;
     $offset = $pageSize * ($page - 1);
     // $page starts from 1
     //		$keywords_array = mySearchUtils::getKeywordsFromStr ( $searchText );
     // TODO_ change mechanism !
     //$search_mechanism = self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW;
     $search_mechanism = self::KALTURA_SERVICE_CRITERIA_FROM_ROUGHCUT;
     // TODO - optimize the first part of the entry_id search
     // cache once we know the kshow_ids / roughcuts - this will make paginating much faster
     $kshow_crit = new Criteria();
     $kshow_crit->clearSelectColumns()->clearOrderByColumns();
     $kshow_crit->addSelectColumn(kshowPeer::ID);
     $kshow_crit->addSelectColumn(kshowPeer::SHOW_ENTRY_ID);
     $kshow_crit->setLimit(self::$s_default_count_limit);
     $kshow_filter->addSearchMatchToCriteria($kshow_crit, $searchText, kshow::getSearchableColumnName());
     if ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW) {
         $kshow_crit->add(kshowPeer::ENTRIES, 1, criteria::GREATER_EQUAL);
     }
     $rs = kshowPeer::doSelectStmt($kshow_crit);
     $kshow_arr = array();
     $roughcut_arr = array();
     $res = $rs->fetchAll();
     foreach ($res as $record) {
         $kshow_arr[] = $record[0];
         $roughcut_arr[] = $record[1];
     }
     //		// old code from doSelectRs
     //		while($rs->next())
     //		{
     //			$kshow_arr[] = $rs->getString(1);
     //			$roughcut_arr[] = $rs->getString(2);
     //		}
     $crit = new Criteria();
     $crit->setOffset($offset);
     $crit->setLimit($limit);
     $crit->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
     $crit->add(entryPeer::MEDIA_TYPE, $media_type);
     if ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW) {
         $crit->add(entryPeer::KSHOW_ID, $kshow_arr, Criteria::IN);
         $entry_results = entryPeer::doSelect($crit);
     } elseif ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_ROUGHCUT) {
         //			$entry_results  = roughcutEntryPeer::retrievByRoughcutIds ( $crit , $roughcut_arr , true );
         $entry_results = roughcutEntryPeer::retrievEntriesByRoughcutIds($crit, $roughcut_arr);
     }
     // after the query - return the filter to what it was before
     $entry_criteria->addAnd(entryPeer::PARTNER_ID, $original_entry_partner_to_filter);
     $kshow_criteria->addAnd(kshowPeer::PARTNER_ID, $original_kshow_partner_to_filter);
     $objects = array();
     // add thumbs when not image or video
     $should_add_thumbs = $media_type != entry::ENTRY_MEDIA_TYPE_AUDIO;
     foreach ($entry_results as $obj) {
         if ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW) {
             $entry = $obj;
         } else {
             //$entry = $obj->getEntry();
             $entry = $obj;
         }
         /* @var $entry entry */
         // use the id as the url - it will help using this entry id in addentry
         $object = array("id" => $entry->getId(), "url" => $entry->getDataUrl(), "tags" => $entry->getTags(), "title" => $entry->getName(), "description" => $entry->getTags(), "flash_playback_type" => $entry->getMediaTypeName());
         if ($should_add_thumbs) {
             $object["thumb"] = $entry->getThumbnailUrl();
         }
         $objects[] = $object;
     }
     return array('status' => $status, 'message' => $message, 'objects' => $objects, "needMediaInfo" => self::$NEED_MEDIA_INFO);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:91,代码来源:myKalturaKshowServices.class.php

示例2: attachCriteriaFilter

 /**
  * the filterCriteria will filter out all the doSelect methods - ONLY if the filter is turned on.
  * IMPORTANT - the filter is turend on by default and when switched off - should be turned on again manually .
  * 
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  */
 protected static function attachCriteriaFilter(Criteria $criteria)
 {
     kshowPeer::getCriteriaFilter()->applyFilter($criteria);
 }
开发者ID:dozernz,项目名称:server,代码行数:10,代码来源:BasekshowPeer.php


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