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


PHP entryFilter::getLimit方法代码示例

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


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

示例1: toQueryString

 public static function toQueryString(entry $playlist, $should_append_filter_to_url = false)
 {
     $query = "playlist_id={$playlist->getId()}";
     if ($playlist->getMediaType() != entry::ENTRY_MEDIA_TYPE_XML) {
         return $query;
     }
     if (!$should_append_filter_to_url) {
         return $query;
     }
     $xml = $playlist->getDataContent();
     list($total_results, $list_of_filters) = self::getPlaylistFilterListStruct($xml);
     $entry_filters = array();
     $partner_id = $playlist->getPartnerId();
     // add ks=_KS_ for the playlist to replace it before hitting the executePlaylist
     $query .= "&fp=f";
     // make sure the filter prefix is short
     if (!$list_of_filters) {
         return $query;
     }
     $i = 1;
     // the extra_filter is 1-based
     foreach ($list_of_filters as $entry_filter_xml) {
         $prefix = "f{$i}_";
         // 	in general this service can fetch entries from kaltura networks.
         // for each filter we should decide if thie assumption is true...
         $allow_partner_only = true;
         // compile all the filters - only then execute them if not yet reached the total_results
         // TODO - optimize - maybe create them only when needed. - For now it's safer to compile all even if not needed.
         $entry_filter = new entryFilter();
         // add the desired prefix "_" because the XML is not expected to have it while the entryFilter class expects it
         $entry_filter->fillObjectFromXml($entry_filter_xml, "_");
         // make sure there is alway a limit for each filter - if not an explicit one - the system limit should be used
         if ($entry_filter->getLimit() == null || $entry_filter->getLimit() < 1) {
             $entry_filter->setLimit(self::TOTAL_RESULTS);
         }
         $entry_filter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
         self::updateEntryFilter($entry_filter, $partner_id);
         //$entry_filters[] = $entry_filter;
         $fields = $entry_filter->fields;
         foreach ($fields as $field => $value) {
             if ($value) {
                 $query .= "&" . $prefix . $field . "=" . $value;
             }
         }
         $i++;
     }
     return $query;
 }
开发者ID:GElkayam,项目名称:server,代码行数:48,代码来源:myPlaylistUtils.class.php


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