本文整理汇总了PHP中assetParamsPeer::setDefaultCriteriaFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP assetParamsPeer::setDefaultCriteriaFilter方法的具体用法?PHP assetParamsPeer::setDefaultCriteriaFilter怎么用?PHP assetParamsPeer::setDefaultCriteriaFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetParamsPeer
的用法示例。
在下文中一共展示了assetParamsPeer::setDefaultCriteriaFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFlavorParamsFromFileFormat
/**
* return the flavor params the best fits the fileFormat for a given partner_id
*
* @param int $partnerId
* @param string $fileFormat
* @return FlavorParams
*/
public static function getFlavorParamsFromFileFormat($partnerId, $fileFormat, $ignoreSourceTag = true)
{
$defaultCriteria = assetParamsPeer::getCriteriaFilter()->getFilter();
$defaultCriteria->remove(assetParamsPeer::PARTNER_ID);
// assetParamsPeer::allowAccessToPartner0AndPartnerX($partnerId); // the flavor params can be from partner 0 too
$c = new Criteria();
$c->addAnd(assetParamsPeer::PARTNER_ID, array($partnerId, 0), Criteria::IN);
// $c->add ( assetParamsPeer::FORMAT , $fileFormat );
$possible_flavor_params = assetParamsPeer::doSelect($c);
assetParamsPeer::setDefaultCriteriaFilter();
$best_fp = null;
foreach ($possible_flavor_params as $fp) {
if ($fileFormat != $fp->getFormat()) {
continue;
}
if ($ignoreSourceTag && $fp->hasTag(flavorParams::TAG_SOURCE)) {
continue;
}
if (!$best_fp) {
$best_fp = $fp;
}
if ($fp->getPartnerId() != $partnerId) {
continue;
}
// same format for the partner
$best_fp = $fp;
break;
}
// if not fount any - choose the first flavor params from the list
if (!$best_fp) {
$best_fp = $possible_flavor_params[0];
}
return $best_fp;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:41,代码来源:myConversionProfileUtils.class.php
示例2:
/**
* Returns the default criteria filter
*
* @return criteriaFilter The default criteria filter.
*/
public static function &getCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
assetParamsPeer::setDefaultCriteriaFilter();
}
$partnerCriteria = myPartnerUtils::getPartnerCriteriaParams('assetParams');
if ($partnerCriteria) {
call_user_func_array(array('assetParamsPeer', 'addPartnerToCriteria'), $partnerCriteria);
}
return self::$s_criteria_filter;
}
示例3:
/**
* Returns the default criteria filter
*
* @return criteriaFilter The default criteria filter.
*/
public static function &getCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
assetParamsPeer::setDefaultCriteriaFilter();
}
return self::$s_criteria_filter;
}