本文整理汇总了PHP中assetParamsPeer::resetInstanceCriteriaFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP assetParamsPeer::resetInstanceCriteriaFilter方法的具体用法?PHP assetParamsPeer::resetInstanceCriteriaFilter怎么用?PHP assetParamsPeer::resetInstanceCriteriaFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetParamsPeer
的用法示例。
在下文中一共展示了assetParamsPeer::resetInstanceCriteriaFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyConversionProfiles
public static function copyConversionProfiles(Partner $fromPartner, Partner $toPartner)
{
$copiedList = array();
KalturaLog::log("copyConversionProfiles - Copying conversion profiles from partner [" . $fromPartner->getId() . "] to partner [" . $toPartner->getId() . "]");
$c = new Criteria();
$c->add(conversionProfile2Peer::PARTNER_ID, $fromPartner->getId());
$conversionProfiles = conversionProfile2Peer::doSelect($c);
foreach ($conversionProfiles as $conversionProfile) {
$newConversionProfile = $conversionProfile->copy();
$newConversionProfile->setPartnerId($toPartner->getId());
$newConversionProfile->save();
KalturaLog::log("copyConversionProfiles - Copied [" . $conversionProfile->getId() . "], new id is [" . $newConversionProfile->getId() . "]");
$copiedList[$conversionProfile->getId()] = $newConversionProfile->getId();
$c = new Criteria();
$c->add(flavorParamsConversionProfilePeer::CONVERSION_PROFILE_ID, $conversionProfile->getId());
$fpcpList = flavorParamsConversionProfilePeer::doSelect($c);
foreach ($fpcpList as $fpcp) {
$flavorParamsId = $fpcp->getFlavorParamsId();
assetParamsPeer::resetInstanceCriteriaFilter();
$flavorParams = assetParamsPeer::retrieveByPK($flavorParamsId);
if ($flavorParams && $flavorParams->getPartnerId() === 0) {
$newFpcp = $fpcp->copy();
$newFpcp->setConversionProfileId($newConversionProfile->getId());
$newFpcp->save();
}
}
}
$toPartner->save();
// make sure conversion profile is set on the new partner in case it was missed/skiped in the conversionProfile2::copy method
if (!$toPartner->getDefaultConversionProfileId()) {
$fromPartnerDefaultProfile = $fromPartner->getDefaultConversionProfileId();
if ($fromPartnerDefaultProfile && key_exists($fromPartnerDefaultProfile, $copiedList)) {
$toPartner->setDefaultConversionProfileId($copiedList[$fromPartnerDefaultProfile]);
$toPartner->save();
}
}
}
示例2: validateFlavorParamsIds
public function validateFlavorParamsIds()
{
$flavorParamsIds = $this->getFlavorParamsAsArray();
assetParamsPeer::resetInstanceCriteriaFilter();
$flavorParams = assetParamsPeer::retrieveByPKs($flavorParamsIds);
$sourceFound = false;
$indexedFlavorParams = array();
foreach ($flavorParams as $flavorParamsItem) {
if ($flavorParamsItem->hasTag(flavorParams::TAG_SOURCE)) {
if ($sourceFound) {
throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_SOURCE_DUPLICATE);
}
$sourceFound = true;
}
$indexedFlavorParams[$flavorParamsItem->getId()] = $flavorParamsItem;
}
$foundFlavorParams = array();
foreach ($flavorParamsIds as $id) {
if (!isset($indexedFlavorParams[$id])) {
throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_ID_NOT_FOUND, $id);
}
if (in_array($id, $foundFlavorParams)) {
throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_DUPLICATE, $id);
}
$foundFlavorParams[] = $id;
}
}