本文整理汇总了PHP中kEntitlementUtils::setPrivacyContextSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP kEntitlementUtils::setPrivacyContextSearch方法的具体用法?PHP kEntitlementUtils::setPrivacyContextSearch怎么用?PHP kEntitlementUtils::setPrivacyContextSearch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kEntitlementUtils
的用法示例。
在下文中一共展示了kEntitlementUtils::setPrivacyContextSearch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($feedId, $feedProcessingKey = null, $ks = null)
{
$this->feedProcessingKey = $feedProcessingKey;
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
$microTimeStart = microtime(true);
KalturaLog::info("syndicationFeedRenderer- initialize ");
$this->syndicationFeedDb = $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($feedId);
if (!$syndicationFeedDB) {
throw new Exception("Feed Id not found");
}
kCurrentContext::initKsPartnerUser($ks, $syndicationFeedDB->getPartnerId(), '');
kPermissionManager::init();
kEntitlementUtils::initEntitlementEnforcement($syndicationFeedDB->getPartnerId(), $syndicationFeedDB->getEnforceEntitlement());
if (!is_null($syndicationFeedDB->getPrivacyContext()) && $syndicationFeedDB->getPrivacyContext() != '') {
kEntitlementUtils::setPrivacyContextSearch($syndicationFeedDB->getPrivacyContext());
}
$tmpSyndicationFeed = KalturaSyndicationFeedFactory::getInstanceByType($syndicationFeedDB->getType());
$tmpSyndicationFeed->fromObject($syndicationFeedDB);
$this->syndicationFeed = $tmpSyndicationFeed;
// add partner to default criteria
myPartnerUtils::addPartnerToCriteria('category', $this->syndicationFeed->partnerId, true);
myPartnerUtils::addPartnerToCriteria('asset', $this->syndicationFeed->partnerId, true);
myPartnerUtils::resetPartnerFilter('entry');
$this->baseCriteria = clone entryPeer::getDefaultCriteriaFilter();
$startDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::START_DATE, time(), Criteria::LESS_EQUAL);
$startDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::START_DATE, null));
$this->baseCriteria->addAnd($startDateCriterion);
$endDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::END_DATE, time(), Criteria::GREATER_EQUAL);
$endDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::END_DATE, null));
$this->baseCriteria->addAnd($endDateCriterion);
$this->baseCriteria->addAnd(entryPeer::PARTNER_ID, $this->syndicationFeed->partnerId);
$this->baseCriteria->addAnd(entryPeer::STATUS, entryStatus::READY);
$this->baseCriteria->addAnd(entryPeer::TYPE, array(entryType::MEDIA_CLIP, entryType::MIX), Criteria::IN);
$this->baseCriteria->addAnd(entryPeer::MODERATION_STATUS, array(entry::ENTRY_MODERATION_STATUS_REJECTED, entry::ENTRY_MODERATION_STATUS_PENDING_MODERATION), Criteria::NOT_IN);
if ($this->syndicationFeed->playlistId) {
$this->entryFilters = myPlaylistUtils::getPlaylistFiltersById($this->syndicationFeed->playlistId);
foreach ($this->entryFilters as $entryFilter) {
$entryFilter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
// partner scope already attached
}
$playlist = entryPeer::retrieveByPK($this->syndicationFeed->playlistId);
if ($playlist) {
if ($playlist->getMediaType() != entry::ENTRY_MEDIA_TYPE_XML) {
$this->staticPlaylist = true;
$this->staticPlaylistEntriesIdsOrder = explode(',', $playlist->getDataContent());
}
}
} else {
$this->entryFilters = array();
}
$microTimeEnd = microtime(true);
KalturaLog::info("syndicationFeedRenderer- initialization done [" . ($microTimeEnd - $microTimeStart) . "]");
}
示例2: __construct
public function __construct($feedId)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
$microTimeStart = microtime(true);
KalturaLog::info("syndicationFeedRenderer- initialize ");
// initialize the database for all services
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
$this->syndicationFeedDB = $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($feedId);
if (!$syndicationFeedDB) {
throw new Exception("Feed Id not found");
}
kEntitlementUtils::initEntitlementEnforcement($syndicationFeedDB->getPartnerId(), $syndicationFeedDB->getEnforceEntitlement());
if (!is_null($syndicationFeedDB->getPrivacyContext()) && $syndicationFeedDB->getPrivacyContext() != '') {
kEntitlementUtils::setPrivacyContextSearch($syndicationFeedDB->getPrivacyContext());
}
$tmpSyndicationFeed = KalturaSyndicationFeedFactory::getInstanceByType($syndicationFeedDB->getType());
$tmpSyndicationFeed->fromObject($syndicationFeedDB);
$this->syndicationFeed = $tmpSyndicationFeed;
// add partner to default criteria
categoryPeer::addPartnerToCriteria($this->syndicationFeed->partnerId, true);
assetPeer::addPartnerToCriteria($this->syndicationFeed->partnerId, true);
entryPeer::setDefaultCriteriaFilter();
$this->baseCriteria = entryPeer::getDefaultCriteriaFilter();
$startDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::START_DATE, time(), Criteria::LESS_EQUAL);
$startDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::START_DATE, null));
$this->baseCriteria->addAnd($startDateCriterion);
$endDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::END_DATE, time(), Criteria::GREATER_EQUAL);
$endDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::END_DATE, null));
$this->baseCriteria->addAnd($endDateCriterion);
$entryFilter = new entryFilter();
$entryFilter->setPartnerSearchScope($this->syndicationFeed->partnerId);
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setTypeIn(array(entryType::MEDIA_CLIP, entryType::MIX));
$entryFilter->setModerationStatusNotIn(array(entry::ENTRY_MODERATION_STATUS_REJECTED, entry::ENTRY_MODERATION_STATUS_PENDING_MODERATION));
$entryFilter->attachToCriteria($this->baseCriteria);
if ($this->syndicationFeed->playlistId) {
$this->entryFilters = myPlaylistUtils::getPlaylistFiltersById($this->syndicationFeed->playlistId);
foreach ($this->entryFilters as $entryFilter) {
$entryFilter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
// partner scope already attached
}
$playlist = entryPeer::retrieveByPK($this->syndicationFeed->playlistId);
if ($playlist) {
if ($playlist->getMediaType() != entry::ENTRY_MEDIA_TYPE_XML) {
$this->staticPlaylist = true;
$this->staticPlaylistEntriesIdsOrder = explode(',', $playlist->getDataContent());
}
}
} else {
$this->entryFilters = array();
}
$microTimeEnd = microtime(true);
KalturaLog::info("syndicationFeedRenderer- initialization done [" . ($microTimeEnd - $microTimeStart) . "]");
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:55,代码来源:KalturaSyndicationFeedRenderer.php