本文整理汇总了PHP中assetParamsPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP assetParamsPeer::doSelect方法的具体用法?PHP assetParamsPeer::doSelect怎么用?PHP assetParamsPeer::doSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetParamsPeer
的用法示例。
在下文中一共展示了assetParamsPeer::doSelect方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
myPartnerUtils::resetPartnerFilter('assetParams');
$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;
}
示例2: doGetListResponse
protected function doGetListResponse(KalturaFilterPager $pager, array $types = null)
{
$flavorParamsFilter = $this->toObject();
$c = new Criteria();
$flavorParamsFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
if ($types) {
$c->add(assetParamsPeer::TYPE, $types, Criteria::IN);
}
$list = assetParamsPeer::doSelect($c);
$c->setLimit(null);
$totalCount = assetParamsPeer::doCount($c);
return array($list, $totalCount);
}
示例3: execute
public function execute()
{
$this->forceSystemAuthentication();
$this->pid = $this->getRequestParameter("pid", 0);
if (!is_null($this->getRequestParameter("advanced"))) {
$this->getResponse()->setCookie('flavor-params-advanced', $this->getRequestParameter("advanced"));
$this->advanced = (int) $this->getRequestParameter("advanced");
} else {
$this->advanced = (int) $this->getRequest()->getCookie('flavor-params-advanced');
}
myDbHelper::$use_alternative_con = null;
$this->editFlavorParam = null;
$this->editFlavorParam = assetParamsPeer::retrieveByPK($this->getRequestParameter("id"));
if ($this->getRequestParameter("clone")) {
$newFalvorParams = $this->editFlavorParam->copy();
$newFalvorParams->setSourceAssetParamsIds($this->editFlavorParam->getSourceAssetParamsIds());
$newFalvorParams->setAspectRatioProcessingMode($this->editFlavorParam->getAspectRatioProcessingMode());
$newFalvorParams->setForceFrameToMultiplication16($this->editFlavorParam->getForceFrameToMultiplication16());
$newFalvorParams->setIsGopInSec($this->editFlavorParam->getIsGopInSec());
$newFalvorParams->setIsAvoidVideoShrinkFramesizeToSource($this->editFlavorParam->getIsAvoidVideoShrinkFramesizeToSource());
$newFalvorParams->setIsAvoidVideoShrinkBitrateToSource($this->editFlavorParam->getIsAvoidVideoShrinkBitrateToSource());
$newFalvorParams->setIsVideoFrameRateForLowBrAppleHls($this->editFlavorParam->getIsVideoFrameRateForLowBrAppleHls());
$newFalvorParams->setIsAvoidForcedKeyFrames($this->editFlavorParam->getIsAvoidForcedKeyFrames());
$newFalvorParams->setMultiStream($this->editFlavorParam->getMultiStream());
$newFalvorParams->setAnamorphicPixels($this->editFlavorParam->getAnamorphicPixels());
$newFalvorParams->setMaxFrameRate($this->editFlavorParam->getMaxFrameRate());
$newFalvorParams->setWatermarkData($this->editFlavorParam->getWatermarkData());
$newFalvorParams->setIsDefault(false);
$newFalvorParams->setPartnerId(-1);
$newFalvorParams->save();
$this->redirect("system/flavorParams?pid=" . $this->pid . "&id=" . $newFalvorParams->getId());
}
if ($this->getRequestParameter("delete")) {
if ($this->advanced || $this->editFlavorParam->getPartnerId() != 0) {
$this->editFlavorParam->setDeletedAt(time());
$this->editFlavorParam->save();
}
$this->redirect("system/flavorParams?pid=" . $this->pid);
}
if ($this->getRequest()->getMethod() == sfRequest::POST) {
if ($this->advanced || $this->editFlavorParam->getPartnerId() != 0) {
$partnerId = $this->getRequestParameter("partner-id");
if ($this->advanced) {
$this->editFlavorParam->setPartnerId($partnerId);
} else {
if ($partnerId != 0) {
$this->editFlavorParam->setPartnerId($partnerId);
}
}
if ($this->advanced >= 1) {
$this->editFlavorParam->setName($this->getRequestParameter("name"));
$this->editFlavorParam->setSystemName($this->getRequestParameter("systemName"));
$this->editFlavorParam->setDescription($this->getRequestParameter("description"));
$this->editFlavorParam->setIsDefault($this->getRequestParameter("is-default", false));
$this->editFlavorParam->setReadyBehavior($this->getRequestParameter("ready-behavior"));
$this->editFlavorParam->setTags($this->getRequestParameter("tags"));
$this->editFlavorParam->setSourceAssetParamsIds($this->getRequestParameter("sourceAssetParamsIds"));
$this->editFlavorParam->setFormat($this->getRequestParameter("format"));
$this->editFlavorParam->setTwoPass($this->getRequestParameter("two-pass", false));
$this->editFlavorParam->setRotate($this->getRequestParameter("rotate", false));
$this->editFlavorParam->setAspectRatioProcessingMode($this->getRequestParameter("aspectRatioProcessingMode", 0));
$this->editFlavorParam->setIsGopInSec($this->getRequestParameter("isGopInSec", 0));
$this->editFlavorParam->setForceFrameToMultiplication16($this->getRequestParameter("forceFrameToMultiplication16") ? "1" : "0");
$this->editFlavorParam->setIsAvoidVideoShrinkFramesizeToSource($this->getRequestParameter("isAvoidVideoShrinkFramesizeToSource", 0));
$this->editFlavorParam->setIsAvoidVideoShrinkBitrateToSource($this->getRequestParameter("isAvoidVideoShrinkBitrateToSource", 0));
$this->editFlavorParam->setIsVideoFrameRateForLowBrAppleHls($this->getRequestParameter("isVideoFrameRateForLowBrAppleHls", 0));
$this->editFlavorParam->setIsAvoidForcedKeyFrames($this->getRequestParameter("isAvoidForcedKeyFrames", 0));
$this->editFlavorParam->setMultiStream($this->getRequestParameter("multiStream", 0));
$this->editFlavorParam->setAnamorphicPixels($this->getRequestParameter("anamorphicPixels", 0));
$this->editFlavorParam->setWidth($this->getRequestParameter("width"));
$this->editFlavorParam->setHeight($this->getRequestParameter("height"));
$this->editFlavorParam->setVideoCodec($this->getRequestParameter("video-codec"));
$this->editFlavorParam->setVideoBitrate($this->getRequestParameter("video-bitrate"));
$this->editFlavorParam->setWatermarkData($this->getRequestParameter("watermarkData", 0));
$this->editFlavorParam->setFrameRate($this->getRequestParameter("frame-rate"));
$this->editFlavorParam->setMaxFrameRate($this->getRequestParameter("max-frame-rate"));
$this->editFlavorParam->setGopSize($this->getRequestParameter("gop-size"));
$this->editFlavorParam->setAudioCodec($this->getRequestParameter("audio-codec"));
$this->editFlavorParam->setAudioBitrate($this->getRequestParameter("audio-bitrate"));
$this->editFlavorParam->setAudioChannels($this->getRequestParameter("audio-channels"));
$this->editFlavorParam->setAudioSampleRate($this->getRequestParameter("audio-sample-rate"));
$this->editFlavorParam->setAudioResolution($this->getRequestParameter("audio-resolution"));
$this->editFlavorParam->setConversionEngines($this->getRequestParameter("conversion-engines"));
$this->editFlavorParam->setConversionEnginesExtraParams($this->getRequestParameter("conversion-engines-extra-params"));
$this->editFlavorParam->setOperators($this->getRequestParameter("operators"));
$this->editFlavorParam->setEngineVersion($this->getRequestParameter("engine-version"));
$this->editFlavorParam->setType($this->getRequestParameter("type"));
}
$this->editFlavorParam->save();
}
$this->redirect("system/flavorParams?pid=" . $this->editFlavorParam->getPartnerId());
}
$c = new Criteria();
$c->add(assetParamsPeer::PARTNER_ID, array(0, $this->pid), Criteria::IN);
$this->flavorParams = assetParamsPeer::doSelect($c);
$this->formats = self::getEnumValues("flavorParams", "CONTAINER_FORMAT");
$this->videoCodecs = self::getEnumValues("flavorParams", "VIDEO_CODEC");
$this->audioCodecs = self::getEnumValues("flavorParams", "AUDIO_CODEC");
$this->readyBehaviors = self::getEnumValues("flavorParamsConversionProfile", "READY_BEHAVIOR");
$this->creationModes = self::getEnumValues("flavorParams", "CREATION_MODE");
//.........这里部分代码省略.........
示例4: copyFlavorParams
public static function copyFlavorParams(Partner $fromPartner, Partner $toPartner)
{
KalturaLog::log("Copying flavor params from partner [" . $fromPartner->getId() . "] to partner [" . $toPartner->getId() . "]");
$c = new Criteria();
$c->add(assetParamsPeer::PARTNER_ID, $fromPartner->getId());
$flavorParamsObjects = assetParamsPeer::doSelect($c);
foreach ($flavorParamsObjects as $flavorParams) {
$newFlavorParams = $flavorParams->copy();
$newFlavorParams->setPartnerId($toPartner->getId());
$newFlavorParams->save();
KalturaLog::log("Copied [" . $flavorParams->getId() . "], new id is [" . $newFlavorParams->getId() . "]");
}
}
示例5: retrieveByPKs
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, PropelPDO $con = null)
{
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
$criteria->add(assetParamsPeer::ID, $pks, Criteria::IN);
$objs = assetParamsPeer::doSelect($criteria, $con);
}
return $objs;
}
示例6: listAction
/**
* List Thumb Params by filter with paging support (By default - all system default params will be listed too)
*
* @action list
* @param KalturaThumbParamsFilter $filter
* @param KalturaFilterPager $pager
* @return KalturaThumbParamsListResponse
*/
public function listAction(KalturaThumbParamsFilter $filter = null, KalturaFilterPager $pager = null)
{
if (!$filter) {
$filter = new KalturaThumbParamsFilter();
}
if (!$pager) {
$pager = new KalturaFilterPager();
}
$thumbParamsFilter = new assetParamsFilter();
$filter->toObject($thumbParamsFilter);
$c = new Criteria();
$thumbParamsFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
$thumbTypes = KalturaPluginManager::getExtendedTypes(assetParamsPeer::OM_CLASS, assetType::THUMBNAIL);
$c->add(assetParamsPeer::TYPE, $thumbTypes, Criteria::IN);
$dbList = assetParamsPeer::doSelect($c);
$c->setLimit(null);
$totalCount = assetParamsPeer::doCount($c);
$list = KalturaThumbParamsArray::fromDbArray($dbList);
$response = new KalturaThumbParamsListResponse();
$response->objects = $list;
$response->totalCount = $totalCount;
return $response;
}
示例7: retrieveThumbnailsByPKs
public static function retrieveThumbnailsByPKs($pks, PropelPDO $con = null)
{
$criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
$criteria->add(assetParamsPeer::ID, $pks, Criteria::IN);
$types = KalturaPluginManager::getExtendedTypes(assetParamsPeer::OM_CLASS, assetType::THUMBNAIL);
$criteria->add(assetParamsPeer::TYPE, $types, Criteria::IN);
return assetParamsPeer::doSelect($criteria, $con);
}
示例8: doSelect
public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
self::getInstance();
return parent::doSelect($criteria, $con);
}
示例9: getFlavorAssetsWithParamsAction
/**
* Get Flavor Asset with the relevant Flavor Params (Flavor Params can exist without Flavor Asset & vice versa)
*
* @action getFlavorAssetsWithParams
* @param string $entryId
* @return KalturaFlavorAssetWithParamsArray
*/
public function getFlavorAssetsWithParamsAction($entryId)
{
$dbEntry = entryPeer::retrieveByPK($entryId);
if (!$dbEntry) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
}
// get all the flavor params of partner 0 and the current partner (note that partner 0 is defined as partner group in service.ct)
$c = new Criteria();
$flavorTypes = assetParamsPeer::retrieveAllFlavorParamsTypes();
$c->add(assetParamsPeer::TYPE, $flavorTypes, Criteria::IN);
$partnerIds = array($dbEntry->getPartnerId(), PartnerPeer::GLOBAL_PARTNER);
$c->add(assetParamsPeer::PARTNER_ID, array_map('strval', $partnerIds), Criteria::IN);
$flavorParamsDb = assetParamsPeer::doSelect($c);
// get the flavor assets for this entry
$c = new Criteria();
$flavorTypes = assetPeer::retrieveAllFlavorsTypes();
$c->add(assetPeer::TYPE, $flavorTypes, Criteria::IN);
$c->add(assetPeer::ENTRY_ID, $entryId);
$c->add(assetPeer::STATUS, array(flavorAsset::FLAVOR_ASSET_STATUS_DELETED, flavorAsset::FLAVOR_ASSET_STATUS_TEMP), Criteria::NOT_IN);
$flavorAssetsDb = assetPeer::doSelect($c);
// find what flavot params are required
$requiredFlavorParams = array();
foreach ($flavorAssetsDb as $item) {
$requiredFlavorParams[$item->getFlavorParamsId()] = true;
}
// now merge the results, first organize the flavor params in an array with the id as the key
$flavorParamsArray = array();
foreach ($flavorParamsDb as $item) {
$flavorParams = $item->getId();
$flavorParamsArray[$flavorParams] = $item;
if (isset($requiredFlavorParams[$flavorParams])) {
unset($requiredFlavorParams[$flavorParams]);
}
}
// adding missing required flavors params to the list
if (count($requiredFlavorParams)) {
$flavorParamsDb = assetParamsPeer::retrieveByPKsNoFilter(array_keys($requiredFlavorParams));
foreach ($flavorParamsDb as $item) {
$flavorParamsArray[$item->getId()] = $item;
}
}
$usedFlavorParams = array();
// loop over the flavor assets and add them, if it has flavor params add them too
$flavorAssetWithParamsArray = new KalturaFlavorAssetWithParamsArray();
foreach ($flavorAssetsDb as $flavorAssetDb) {
$flavorParamsId = $flavorAssetDb->getFlavorParamsId();
$flavorAssetWithParams = new KalturaFlavorAssetWithParams();
$flavorAssetWithParams->entryId = $entryId;
$flavorAsset = KalturaFlavorAsset::getInstance($flavorAssetDb, $this->getResponseProfile());
$flavorAssetWithParams->flavorAsset = $flavorAsset;
if (isset($flavorParamsArray[$flavorParamsId])) {
$flavorParamsDb = $flavorParamsArray[$flavorParamsId];
$flavorParams = KalturaFlavorParamsFactory::getFlavorParamsInstance($flavorParamsDb->getType());
$flavorParams->fromObject($flavorParamsDb, $this->getResponseProfile());
$flavorAssetWithParams->flavorParams = $flavorParams;
// we want to log which flavor params are in use, there could be more
// than one flavor asset using same params
$usedFlavorParams[$flavorParamsId] = $flavorParamsId;
}
// else if ($flavorAssetDb->getIsOriginal())
// {
// // create a dummy flavor params
// $flavorParams = new KalturaFlavorParams();
// $flavorParams->name = "Original source";
// $flavorAssetWithParams->flavorParams = $flavorParams;
// }
$flavorAssetWithParamsArray[] = $flavorAssetWithParams;
}
// copy the remaining params
foreach ($flavorParamsArray as $flavorParamsId => $flavorParamsDb) {
if (isset($usedFlavorParams[$flavorParamsId])) {
// flavor params already exists for a flavor asset, not need
// to list it one more time
continue;
}
$flavorParams = KalturaFlavorParamsFactory::getFlavorParamsInstance($flavorParamsDb->getType());
$flavorParams->fromObject($flavorParamsDb, $this->getResponseProfile());
$flavorAssetWithParams = new KalturaFlavorAssetWithParams();
$flavorAssetWithParams->entryId = $entryId;
$flavorAssetWithParams->flavorParams = $flavorParams;
$flavorAssetWithParamsArray[] = $flavorAssetWithParams;
}
return $flavorAssetWithParamsArray;
}
示例10: Criteria
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_VIDEO_BITRATE, $assetParam->getVideoBitrate());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_AUDIO_CODEC, $assetParam->getAudioCodec());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_AUDIO_BITRATE, $assetParam->getAudioBitrate());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_AUDIO_CHANNELS, $assetParam->getAudioChannels());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_AUDIO_SAMPLE_RATE, $assetParam->getAudioSampleRate());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_AUDIO_RESOLUTION, $assetParam->getAudioResolution());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_FRAME_RATE, $assetParam->getFrameRate());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_GOP_SIZE, $assetParam->getGopSize());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_TWO_PASS, $assetParam->getTwoPass());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_DEINTERLICE, $assetParam->getDeinterlice());
$assetParam->putInCustomData(flavorParams::CUSTOM_DATA_FIELD_ROTATE, $assetParam->getRotate());
}
$assetParam->save();
}
assetParamsPeer::clearInstancePool();
$assetParams = assetParamsPeer::doSelect($c, $con);
}
$c = new Criteria();
$c->add(assetParamsOutputPeer::TYPE, 0);
$c->setLimit($entryLimitEachLoop);
$assetParamsOutputs = assetParamsOutputPeer::doSelect($c, $con);
while (count($assetParamsOutputs)) {
foreach ($assetParamsOutputs as $assetParamsOutput) {
switch ($assetParamsOutput->getFormat()) {
case assetParams::CONTAINER_FORMAT_PDF:
$assetParamsOutput->setType(DocumentAssetType::get()->coreValue(DocumentAssetType::PDF));
break;
case assetParams::CONTAINER_FORMAT_SWF:
$assetParamsOutput->setType(DocumentAssetType::get()->coreValue(DocumentAssetType::SWF));
break;
case thumbParams::CONTAINER_FORMAT_JPG: