本文整理汇总了PHP中KalturaCriteria类的典型用法代码示例。如果您正苦于以下问题:PHP KalturaCriteria类的具体用法?PHP KalturaCriteria怎么用?PHP KalturaCriteria使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KalturaCriteria类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Called on the server side and enables you to populate the object with any data from the DB
*
* @param KalturaDistributionJobData $distributionJobData
*/
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaFreewheelGenericDistributionProfile) {
return;
}
$this->videoAssetFilePaths = new KalturaStringArray();
// loads all the flavor assets that should be submitted to the remote destination site
$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
foreach ($flavorAssets as $flavorAsset) {
$videoAssetFilePath = new KalturaString();
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$videoAssetFilePath->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
$this->videoAssetFilePaths[] = $videoAssetFilePath;
}
$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
if (count($thumbAssets)) {
$thumbAsset = reset($thumbAssets);
$syncKey = $thumbAssets->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->thumbAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
}
// entry cue points
$c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
$c->add(CuePointPeer::PARTNER_ID, $distributionJobData->entryDistribution->partnerId);
$c->add(CuePointPeer::ENTRY_ID, $distributionJobData->entryDistribution->entryId);
$c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD));
$c->addAscendingOrderByColumn(CuePointPeer::START_TIME);
$cuePointsDb = CuePointPeer::doSelect($c);
$this->cuePoints = KalturaCuePointArray::fromDbArray($cuePointsDb);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:38,代码来源:KalturaFreewheelGenericDistributionJobProviderData.php
示例2: doGetListResponse
protected function doGetListResponse(KalturaFilterPager $pager, $type = null)
{
$this->validateEntryIdFiltered();
if (!is_null($this->userIdEqualCurrent) && $this->userIdEqualCurrent) {
$this->userIdEqual = kCurrentContext::getCurrentKsKuserId();
} else {
$this->translateUserIds();
}
$c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
if ($type) {
$c->add(CuePointPeer::TYPE, $type);
}
$entryIds = null;
if ($this->entryIdEqual) {
$entryIds = array($this->entryIdEqual);
} else {
if ($this->entryIdIn) {
$entryIds = explode(',', $this->entryIdIn);
}
}
if (!is_null($entryIds)) {
$entryIds = entryPeer::filterEntriesByPartnerOrKalturaNetwork($entryIds, kCurrentContext::getCurrentPartnerId());
if (!$entryIds) {
return array(array(), 0);
}
$this->entryIdEqual = null;
$this->entryIdIn = implode(',', $entryIds);
}
$cuePointFilter = $this->toObject();
$cuePointFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
$list = CuePointPeer::doSelect($c);
return array($list, $c->getRecordsCount());
}
开发者ID:visomar,项目名称:server,代码行数:34,代码来源:KalturaCuePointFilter.php
示例3: applyCondition
/**
* Adds conditions, matches and where clauses to the query
* @param IKalturaIndexQuery $query
*/
public function applyCondition(IKalturaDbQuery $query)
{
switch ($this->getComparison()) {
case KalturaSearchConditionComparison::EQUAL:
$comparison = ' = ';
break;
case KalturaSearchConditionComparison::GREATER_THAN:
$comparison = ' > ';
break;
case KalturaSearchConditionComparison::GREATER_THAN_OR_EQUAL:
$comparison = ' >= ';
break;
case KalturaSearchConditionComparison::LESS_THAN:
$comparison = " < ";
break;
case KalturaSearchConditionComparison::LESS_THAN_OR_EQUAL:
$comparison = " <= ";
break;
case KalturaSearchConditionComparison::NOT_EQUAL:
$comparison = " <> ";
break;
default:
KalturaLog::ERR("Missing comparison type");
return;
}
$field = $this->getField();
$value = $this->getValue();
$fieldValue = $this->getFieldValue($field);
if (is_null($fieldValue)) {
KalturaLog::err('Unknown field [' . $field . ']');
return;
}
$newCondition = $fieldValue . $comparison . KalturaCriteria::escapeString($value);
$query->addCondition($newCondition);
}
开发者ID:kubrickfr,项目名称:server,代码行数:39,代码来源:AdvancedSearchFilterComparableCondition.class.php
示例4: fetchPage
public function fetchPage($action, $filter, $my_pager, $base_criteria = null)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
$keywords = @$_REQUEST["keywords"];
// $sort_alias is what is sent from the browser
$sort_alias = $this->sort_alias != null ? $this->sort_alias : @$_REQUEST["sort"];
// $keywords_array = mySearchUtils::getKeywordsFromStr ( $keywords );
if ($base_criteria != null) {
$c = $base_criteria;
} else {
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
}
$filter->addSearchMatchToCriteria($c, $keywords, $this->getSearchableColumnName());
// each entity can do specific modifications to the criteria
$this->modifyCriteria($c);
if ($this->skip_count) {
$my_pager->attachCriteria($c, $this->getPeerMethod(), $this->getPeerCountMethod());
//$res = $my_pager->fetchPage(null , true , 0);
$res = $my_pager->fetchPage(null);
// , true , 0);
} else {
$my_pager->attachCriteria($c, $this->getPeerMethod(), $this->getPeerCountMethod());
$res = $my_pager->fetchPage();
}
return $res;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:26,代码来源:AJAX_getObjectsAction.class.php
示例5: setDefaultCriteriaFilter
/**
* Creates default criteria filter
*/
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(self::OM_CLASS);
self::$s_criteria_filter->setFilter($c);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:11,代码来源:TagPeer.php
示例6: getFeedAction
/**
* @action getFeed
* @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
* @param int $distributionProfileId
* @param string $hash
* @return file
*/
public function getFeedAction($distributionProfileId, $hash)
{
if (!$this->getPartnerId() || !$this->getPartner()) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $this->getPartnerId());
}
$profile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
if (!$profile || !$profile instanceof UverseDistributionProfile) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $distributionProfileId);
}
if ($profile->getStatus() != KalturaDistributionProfileStatus::ENABLED) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_DISABLED, $distributionProfileId);
}
if ($profile->getUniqueHashForFeedUrl() != $hash) {
throw new KalturaAPIException(UverseDistributionErrors::INVALID_FEED_URL);
}
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($profile->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setHasEntryDistributionValidationErrors(false);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
$entryFilter->setPartnerSearchScope($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
$baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
$baseCriteria->add(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM, Criteria::NOT_EQUAL);
$entryFilter->attachToCriteria($baseCriteria);
$entries = entryPeer::doSelect($baseCriteria);
$feed = new UverseFeed('uverse_template.xml');
$feed->setDistributionProfile($profile);
$feed->setChannelFields();
$lastBuildDate = $profile->getUpdatedAt(null);
foreach ($entries as $entry) {
/* @var $entry entry */
$entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $profile->getId());
if (!$entryDistribution) {
KalturaLog::err('Entry distribution was not found for entry [' . $entry->getId() . '] and profile [' . $profile->getId() . ']');
continue;
}
$fields = $profile->getAllFieldValues($entryDistribution);
$flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
$flavorAsset = reset($flavorAssets);
$flavorAssetRemoteUrl = $entryDistribution->getFromCustomData(UverseEntryDistributionCustomDataField::REMOTE_ASSET_URL);
$thumbAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getThumbAssetIds()));
$feed->addItem($fields, $flavorAsset, $flavorAssetRemoteUrl, $thumbAssets);
// we want to find the newest update time between all entries
if ($entry->getUpdatedAt(null) > $lastBuildDate) {
$lastBuildDate = $entry->getUpdatedAt(null);
}
}
$feed->setChannelLastBuildDate($lastBuildDate);
header('Content-Type: text/xml');
echo $feed->getXml();
die;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:65,代码来源:UverseService.php
示例7: getFeedAction
/**
* @action getFeed
* @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
* @param int $distributionProfileId
* @param string $hash
* @return file
*/
public function getFeedAction($distributionProfileId, $hash)
{
if (!$this->getPartnerId() || !$this->getPartner()) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $this->getPartnerId());
}
$profile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
if (!$profile || !$profile instanceof SynacorHboDistributionProfile) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $distributionProfileId);
}
if ($profile->getStatus() != KalturaDistributionProfileStatus::ENABLED) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_DISABLED, $distributionProfileId);
}
if ($profile->getUniqueHashForFeedUrl() != $hash) {
throw new KalturaAPIException(SynacorHboDistributionErrors::INVALID_FEED_URL);
}
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($profile->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setEntryDistributionFlag(EntryDistributionDirtyStatus::NONE);
$distributionAdvancedSearch->setHasEntryDistributionValidationErrors(false);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
$entryFilter->setPartnerSearchScope($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
$baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
$baseCriteria->add(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM, Criteria::NOT_EQUAL);
$entryFilter->attachToCriteria($baseCriteria);
$entries = entryPeer::doSelect($baseCriteria);
$feed = new SynacorHboFeed('synacor_hbo_feed_template.xml');
$feed->setDistributionProfile($profile);
$counter = 0;
foreach ($entries as $entry) {
/* @var $entry entry */
$entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $profile->getId());
if (!$entryDistribution) {
KalturaLog::err('Entry distribution was not found for entry [' . $entry->getId() . '] and profile [' . $profile->getId() . ']');
continue;
}
$fields = $profile->getAllFieldValues($entryDistribution);
$flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
$thumbAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getThumbAssetIds()));
$additionalAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getAssetIds()));
$feed->addItem($fields, $entry, $flavorAssets, $thumbAssets, $additionalAssets);
$counter++;
//to avoid the cache exceeding the memory size
if ($counter >= 100) {
kMemoryManager::clearMemory();
$counter = 0;
}
}
header('Content-Type: text/xml');
echo $feed->getXml();
die;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:65,代码来源:SynacorHboService.php
示例8: getCuePoints
/**
* @param $partnerId
* @param $entryId
*/
protected function getCuePoints($partnerId, $entryId)
{
$c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
$c->add(CuePointPeer::PARTNER_ID, $partnerId);
$c->add(CuePointPeer::ENTRY_ID, $entryId);
$c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD));
$c->addAscendingOrderByColumn(CuePointPeer::START_TIME);
return CuePointPeer::doSelect($c);
}
开发者ID:DBezemer,项目名称:server,代码行数:13,代码来源:ComcastMrssService.php
示例9: setDefaultCriteriaFilter
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(kuserPeer::OM_CLASS);
$c->addAnd(kuserPeer::STATUS, KuserStatus::DELETED, KalturaCriteria::NOT_EQUAL);
self::$s_criteria_filter->setFilter($c);
}
开发者ID:DBezemer,项目名称:server,代码行数:9,代码来源:kuserPeer.php
示例10: setDefaultCriteriaFilter
/**
* Creates default criteria filter
*/
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(KuserKgroupPeer::OM_CLASS);
$c->addAnd(KuserKgroupPeer::STATUS, array(KuserKgroupStatus::DELETED), Criteria::NOT_IN);
$c->addAnd(KuserKgroupPeer::PARTNER_ID, kCurrentContext::getCurrentPartnerId(), Criteria::EQUAL);
self::$s_criteria_filter->setFilter($c);
}
开发者ID:kubrickfr,项目名称:server,代码行数:13,代码来源:KuserKgroupPeer.php
示例11: __construct
/**
* Called on the server side and enables you to populate the object with any data from the DB
*
* @param KalturaDistributionJobData $distributionJobData
*/
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaHuluDistributionProfile) {
return;
}
// loads all the flavor assets that should be submitted to the remote destination site
$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
if (count($flavorAssets)) {
$flavorAsset = reset($flavorAssets);
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->videoAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
}
$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
if (count($thumbAssets)) {
$thumbAsset = reset($thumbAssets);
$syncKey = $thumbAsset->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->thumbAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
}
$additionalAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->assetIds));
$this->captionLocalPaths = new KalturaStringArray();
if (count($additionalAssets)) {
$captionAssetFilePathArray = array();
foreach ($additionalAssets as $additionalAsset) {
$assetType = $additionalAsset->getType();
$syncKey = $additionalAsset->getSyncKey(CaptionAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
if (kFileSyncUtils::fileSync_exists($syncKey)) {
if ($assetType == CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION) || $assetType == AttachmentPlugin::getAssetTypeCoreValue(AttachmentAssetType::ATTACHMENT)) {
$string = new KalturaString();
$string->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
$this->captionLocalPaths[] = $string;
}
}
}
}
$tempFieldValues = unserialize($this->fieldValues);
$pattern = '/[^A-Za-z0-9_\\-]/';
$seriesTitle = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::SERIES_TITLE]);
$seasonNumber = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::SEASON_NUMBER]);
$videoEpisodeNumber = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::VIDEO_EPISODE_NUMBER]);
$videoTitle = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::VIDEO_TITLE]);
$this->fileBaseName = $seriesTitle . '-' . $seasonNumber . '-' . $videoEpisodeNumber . '-' . $videoTitle;
// entry cue points
$c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
$c->add(CuePointPeer::PARTNER_ID, $distributionJobData->entryDistribution->partnerId);
$c->add(CuePointPeer::ENTRY_ID, $distributionJobData->entryDistribution->entryId);
$c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD));
$c->addAscendingOrderByColumn(CuePointPeer::START_TIME);
$cuePointsDb = CuePointPeer::doSelect($c);
$this->cuePoints = KalturaCuePointArray::fromDbArray($cuePointsDb);
}
开发者ID:DBezemer,项目名称:server,代码行数:59,代码来源:KalturaHuluDistributionJobProviderData.php
示例12: applyCondition
/**
* Adds conditions, matches and where clauses to the query
* @param IKalturaDbQuery $query
*/
public function applyCondition(IKalturaDbQuery $query)
{
if (!$query instanceof IKalturaIndexQuery) {
return;
}
$matchText = '"' . KalturaCriteria::escapeString($this->value) . '"';
if ($this->not) {
$matchText = '!' . $matchText;
}
$query->addMatch("@{$this->field} (" . $matchText . ")");
}
开发者ID:DBezemer,项目名称:server,代码行数:15,代码来源:AdvancedSearchFilterMatchAttributeCondition.class.php
示例13: resolveCategoryTag
function resolveCategoryTag(Tag $tag)
{
$c = KalturaCriteria::create(categoryPeer::OM_CLASS);
$c->add(categoryPeer::PARTNER_ID, $tag->getPartnerId());
$categoryFilter = new categoryFilter();
$categoryFilter->set('_mlikeand_tags', $tag->getTag());
$categoryFilter->attachToCriteria($c);
$count = $c->getRecordsCount();
if (!$count) {
$tag->delete();
}
}
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:resolveTags.php
示例14: setDefaultCriteriaFilter
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(UserEntryPeer::OM_CLASS);
// when session is not admin, allow access to user's userEntries only
if (kCurrentContext::$ks && !kCurrentContext::$is_admin_session) {
$c->addAnd(UserEntryPeer::KUSER_ID, kCurrentContext::getCurrentKsKuserId());
}
self::$s_criteria_filter->setFilter($c);
}
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:UserEntryPeer.php
示例15: setDefaultCriteriaFilter
/**
* Creates default criteria filter
*/
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(self::OM_CLASS);
if (kEntitlementUtils::getEntitlementEnforcement()) {
$privacyContexts = kEntitlementUtils::getKsPrivacyContextArray();
$c->addAnd(self::PRIVACY_CONTEXT, $privacyContexts, Criteria::IN);
}
$c->addAnd(self::INSTANCE_COUNT, 0, Criteria::GREATER_THAN);
self::$s_criteria_filter->setFilter($c);
}
开发者ID:DBezemer,项目名称:server,代码行数:16,代码来源:TagPeer.php
示例16: doGetListResponse
protected function doGetListResponse(KalturaFilterPager $pager, array $types = null)
{
$this->validateEntryIdFiltered();
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
// verify access to the relevant entries - either same partner as the KS or kaltura network
if ($this->entryIdEqual) {
$entryIds = array($this->entryIdEqual);
} else {
if ($this->entryIdIn) {
$entryIds = explode(',', $this->entryIdIn);
} else {
throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'KalturaAssetFilter::entryIdEqual/KalturaAssetFilter::entryIdIn');
}
}
$entryIds = array_slice($entryIds, 0, baseObjectFilter::getMaxInValues());
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$c->addAnd(entryPeer::ID, $entryIds, Criteria::IN);
$criterionPartnerOrKn = $c->getNewCriterion(entryPeer::PARTNER_ID, kCurrentContext::getCurrentPartnerId());
$criterionPartnerOrKn->addOr($c->getNewCriterion(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK));
$c->addAnd($criterionPartnerOrKn);
$dbEntries = entryPeer::doSelect($c);
if (!$dbEntries) {
return array(array(), 0);
}
$entryIds = array();
foreach ($dbEntries as $dbEntry) {
$entryIds[] = $dbEntry->getId();
}
$this->entryIdEqual = null;
$this->entryIdIn = implode(',', $entryIds);
// get the flavors
$flavorAssetFilter = new AssetFilter();
$this->toObject($flavorAssetFilter);
$c = new Criteria();
$flavorAssetFilter->attachToCriteria($c);
if ($types) {
$c->add(assetPeer::TYPE, $types, Criteria::IN);
}
$pager->attachToCriteria($c);
$list = assetPeer::doSelect($c);
$resultCount = count($list);
if ($resultCount && $resultCount < $pager->pageSize) {
$totalCount = ($pager->pageIndex - 1) * $pager->pageSize + $resultCount;
} else {
KalturaFilterPager::detachFromCriteria($c);
$totalCount = assetPeer::doCount($c);
}
myDbHelper::$use_alternative_con = null;
return array($list, $totalCount);
}
开发者ID:visomar,项目名称:server,代码行数:50,代码来源:KalturaAssetFilter.php
示例17: getListResponse
public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
{
$entryFilter = new QuizEntryFilter();
$entryFilter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
$this->toObject($entryFilter);
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
if ($pager) {
$pager->attachToCriteria($c);
}
$entryFilter->attachToCriteria($c);
$list = entryPeer::doSelect($c);
$response = new KalturaQuizListResponse();
$response->objects = KalturaQuizArray::fromDbArray($list, $responseProfile);
$response->totalCount = $c->getRecordsCount();
return $response;
}
开发者ID:DBezemer,项目名称:server,代码行数:16,代码来源:KalturaQuizFilter.php
示例18: getListResponse
public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
{
if ($this->orderBy === null) {
$this->orderBy = KalturaCategoryOrderBy::DEPTH_ASC;
}
$categoryFilter = $this->toObject();
$c = KalturaCriteria::create(categoryPeer::OM_CLASS);
$categoryFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
$dbList = categoryPeer::doSelect($c);
$totalCount = $c->getRecordsCount();
$list = KalturaCategoryArray::fromDbArray($dbList, $responseProfile);
$response = new KalturaCategoryListResponse();
$response->objects = $list;
$response->totalCount = $totalCount;
return $response;
}
开发者ID:AdiTal,项目名称:server,代码行数:17,代码来源:KalturaCategoryFilter.php
示例19: searchAction
/**
* @action search
*
* Action to search tags using a string of 3 letters or more.
* @param KalturaTagFilter $tagFilter
* @param KalturaFilterPager $pager
* @return KalturaTagListResponse
*/
public function searchAction(KalturaTagFilter $tagFilter, KalturaFilterPager $pager = null)
{
if (!$tagFilter) {
$tagFilter = new KalturaTagFilter();
}
if (!$pager) {
$pager = new KalturaFilterPager();
}
$tagFilter->validate();
$c = KalturaCriteria::create(TagPeer::OM_CLASS);
$tagCoreFilter = new TagFilter();
$tagFilter->toObject($tagCoreFilter);
$tagCoreFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
$tags = TagPeer::doSelect($c);
$searchResponse = new KalturaTagListResponse();
$searchResponse->objects = KalturaTagArray::fromDbArray($tags);
$searchResponse->totalCount = $c->getRecordsCount();
return $searchResponse;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:28,代码来源:TagService.php
示例20: getEntitledKusers
public function getEntitledKusers()
{
$entitledKusersPublish = explode(',', $this->getEntitledKusersPublish());
$entitledKusersEdit = explode(',', $this->getEntitledKusersEdit());
$entitledKusersNoPrivacyContext = array_merge($entitledKusersPublish, $entitledKusersEdit);
$entitledKusersNoPrivacyContext[] = $this->getKuserId();
foreach ($entitledKusersNoPrivacyContext as $key => $value) {
if (!$value) {
unset($entitledKusersNoPrivacyContext[$key]);
}
}
$entitledKusers = array();
if (count(array_unique($entitledKusersNoPrivacyContext))) {
$entitledKusers[kEntitlementUtils::ENTRY_PRIVACY_CONTEXT] = array_unique($entitledKusersNoPrivacyContext);
}
$allCategoriesIds = $this->getAllCategoriesIds(true);
if (!count($allCategoriesIds)) {
return kEntitlementUtils::ENTRY_PRIVACY_CONTEXT . '_' . implode(' ' . kEntitlementUtils::ENTRY_PRIVACY_CONTEXT . '_', $entitledKusersNoPrivacyContext);
}
$categoryGroupSize = kConf::get('max_number_of_memebrs_to_be_indexed_on_entry');
$partner = $this->getPartner();
if ($partner && $partner->getCategoryGroupSize()) {
$categoryGroupSize = $partner->getCategoryGroupSize();
}
//get categories for this entry that have small amount of members.
$c = KalturaCriteria::create(categoryPeer::OM_CLASS);
$c->add(categoryPeer::ID, $allCategoriesIds, Criteria::IN);
$c->add(categoryPeer::MEMBERS_COUNT, $categoryGroupSize, Criteria::LESS_EQUAL);
$c->add(categoryPeer::ENTRIES_COUNT, kConf::get('category_entries_count_limit_to_be_indexed'), Criteria::LESS_EQUAL);
$c->dontCount();
KalturaCriterion::disableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
$categories = categoryPeer::doSelect($c);
KalturaCriterion::restoreTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
//get all memebrs
foreach ($categories as $category) {
if (!count($category->getMembers())) {
continue;
}
$privacyContexts = explode(',', $category->getPrivacyContexts());
if (!count($privacyContexts)) {
$privacyContexts = array(kEntitlementUtils::DEFAULT_CONTEXT . $this->getPartnerId());
}
foreach ($privacyContexts as $privacyContext) {
$privacyContext = trim($privacyContext);
if (isset($entitledKusers[$privacyContext])) {
$entitledKusers[$privacyContext] = array_merge($entitledKusers[$privacyContext], $category->getMembers());
} else {
$entitledKusers[$privacyContext] = $category->getMembers();
}
}
}
$entitledKusersByContexts = array();
foreach ($entitledKusers as $privacyContext => $kusers) {
$entitledKusersByContexts[] = $privacyContext . '_' . implode(' ' . $privacyContext . '_', $kusers);
}
return implode(' ', $entitledKusersByContexts);
}
开发者ID:AdiTal,项目名称:server,代码行数:57,代码来源:entry.php
注:本文中的KalturaCriteria类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论