本文整理汇总了PHP中myPartnerUtils::addPartnerToCriteria方法的典型用法代码示例。如果您正苦于以下问题:PHP myPartnerUtils::addPartnerToCriteria方法的具体用法?PHP myPartnerUtils::addPartnerToCriteria怎么用?PHP myPartnerUtils::addPartnerToCriteria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::addPartnerToCriteria方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
myPartnerUtils::addPartnerToCriteria(new UserRolePeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
myPartnerUtils::addPartnerToCriteria(new PermissionPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
myPartnerUtils::addPartnerToCriteria(new PermissionItemPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
}
示例2: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
myPartnerUtils::addPartnerToCriteria(new GenericDistributionProviderActionPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
if (!ContentDistributionPlugin::isAllowedPartner(kCurrentContext::$master_partner_id)) {
throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
}
}
示例3: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
if ($actionName != 'goto') {
myPartnerUtils::addPartnerToCriteria(new ShortLinkPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
myPartnerUtils::addPartnerToCriteria(new kuserPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
}
}
示例4: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
if (!DropFolderPlugin::isAllowedPartner($this->getPartnerId())) {
throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
}
myPartnerUtils::addPartnerToCriteria(new DropFolderPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
myPartnerUtils::addPartnerToCriteria(new DropFolderFilePeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
}
示例5: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
if ($this->getPartnerId() != Partner::ADMIN_CONSOLE_PARTNER_ID) {
myPartnerUtils::addPartnerToCriteria(new GenericDistributionProviderPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
}
if (!ContentDistributionPlugin::isAllowedPartner($this->getPartnerId())) {
throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
}
}
示例6: validateForUsage
public function validateForUsage($sourceObject, $propertiesToSkip = array())
{
parent::validateForUsage($sourceObject, $propertiesToSkip);
$this->validatePropertyNotNull('eventNotificationTemplateId');
myPartnerUtils::addPartnerToCriteria('EventNotificationTemplate', kCurrentContext::getCurrentPartnerId(), true);
$eventNotificationTemplate = EventNotificationTemplatePeer::retrieveByPK($this->eventNotificationTemplateId);
if (is_null($eventNotificationTemplate)) {
throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_TEMPLATE_NOT_FOUND, $this->eventNotificationTemplateId);
}
}
示例7: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
$partnerId = $this->getPartnerId();
if (!EventNotificationPlugin::isAllowedPartner($partnerId)) {
throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, "{$this->serviceName}->{$this->actionName}");
}
if ($partnerId != Partner::ADMIN_CONSOLE_PARTNER_ID && $partnerId != Partner::BATCH_PARTNER_ID) {
myPartnerUtils::addPartnerToCriteria(new EventNotificationTemplatePeer(), $partnerId, $this->private_partner_data, $this->partnerGroup());
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:11,代码来源:EventNotificationTemplateService.php
示例8: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser, $create_cachekey = false)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
$limit = $this->getP("page_size", 10);
$limit = $this->maxPageSize($limit);
$page = $this->getP("page", 1);
$user_filter_prefix = $this->getP("fp", "filter");
$offset = ($page - 1) * $limit;
// TODO - should limit search to partner ??
// kuserPeer::setUseCriteriaFilter( false );
// entryPeer::setUseCriteriaFilter( false );
$playlist_id = $this->getPM("playlist_id");
$input_params = $this->getInputParams();
$extra_filters = array();
for ($i = 1; $i < self::MAX_FILTER_COUNT; $i++) {
// filter
$extra_filter = new entryFilter();
$fields_set = $extra_filter->fillObjectFromRequest($input_params, "{$user_filter_prefix}{$i}_", null);
if ($fields_set) {
$extra_filters[$i] = $extra_filter;
}
}
// this service is executed twice! (first time for the cache key, second time for the execution)
if (is_null($this->playlist)) {
$playlist = entryPeer::retrieveByPK($playlist_id);
if (!$playlist) {
throw new APIException(APIErrors::INVALID_ENTRY_ID, "Playlist", $playlist_id);
}
myPartnerUtils::addPartnerToCriteria(new accessControlPeer(), $playlist->getPartnerId(), $this->getPrivatePartnerData(), $this->partnerGroup2(), null);
$this->playlist = $playlist;
}
if ($create_cachekey) {
if ($this->isAdmin()) {
return null;
}
$cache_key_arr = array("playlist_id" => $playlist_id, "filters" => $extra_filters);
$cahce_key = new executionCacheKey();
$cahce_key->expiry = 600;
$cahce_key->key = md5(print_r($cache_key_arr, true));
return $cahce_key;
}
if ($this->isAdmin()) {
myPlaylistUtils::setIsAdminKs(true);
}
$entry_list = myPlaylistUtils::executePlaylistById($partner_id, $playlist_id, $extra_filters, $detailed);
myEntryUtils::updatePuserIdsForEntries($entry_list);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($entry_list, $level);
$this->addMsg("count", count($entry_list));
$this->addMsg($this->getObjectPrefix(), $wrapper);
}
示例9: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
myPartnerUtils::addPartnerToCriteria(new AnnotationPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup(), $this->kalturaNetworkAllowed($action));
// when session is not admin, allow access to user entries only
if (!$this->getKs() || !$this->getKs()->isAdmin()) {
AnnotationPeer::setDefaultCriteriaFilterByKuser();
}
if (!AnnotationPlugin::isAllowedPartner(kCurrentContext::$master_partner_id)) {
throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
}
}
示例10: validateForUsage
public function validateForUsage($sourceObject, $propertiesToSkip = array())
{
parent::validateForUsage($sourceObject, $propertiesToSkip);
$this->validatePropertyNotNull('metadataProfileId');
$this->validatePropertyNotNull('metadataObjectType');
$this->validatePropertyNotNull('xslt');
myPartnerUtils::addPartnerToCriteria('MetadataProfile', kCurrentContext::getCurrentPartnerId(), true);
$metadataProfile = MetadataProfilePeer::retrieveByPK($this->metadataProfileId);
if (is_null($metadataProfile)) {
throw new KalturaAPIException(MetadataErrors::METADATA_PROFILE_NOT_FOUND, $this->metadataProfileId);
}
}
示例11: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser, $create_cachekey = false)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
if (!$detailed) {
$detailed = false;
}
$playlist_id = $this->getPM("playlist_id");
if ($create_cachekey) {
if ($this->isAdmin()) {
return null;
}
$ks_partner_id = null;
$privileges = null;
$ks = ks::fromSecureString(kCurrentContext::$ks);
if ($ks) {
$ks_partner_id = $ks->getPartnerId();
$privileges = $ks->getPrivileges();
}
$cache_key_arr = array("playlist_id" => $playlist_id, "partner_id" => $partner_id, "ks_partner_id" => $ks_partner_id, "detailed" => $detailed, "user" => kCurrentContext::$ks_uid, "privileges" => $privileges, "is_admin" => $this->isAdmin(), "protocol" => infraRequestUtils::getProtocol());
$cahce_key = new executionCacheKey();
$cahce_key->expiry = 600;
$cahce_key->key = md5(print_r($cache_key_arr, true));
return $cahce_key;
}
// this service is executed twice! (first time for the cache key, second time for the execution)
if (is_null($this->playlist)) {
$playlist = entryPeer::retrieveByPK($playlist_id);
if (!$playlist) {
throw new APIException(APIErrors::INVALID_ENTRY_ID, "Playlist", $playlist_id);
}
myPartnerUtils::addPartnerToCriteria('accessControl', $playlist->getPartnerId(), $this->getPrivatePartnerData(), $this->partnerGroup2(), null);
$this->playlist = $playlist;
}
if ($this->isAdmin()) {
myPlaylistUtils::setIsAdminKs(true);
}
$entry_list = myPlaylistUtils::executePlaylistById($partner_id, $playlist_id, null, $detailed);
myEntryUtils::updatePuserIdsForEntries($entry_list);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($entry_list, $level);
$this->addMsg("count", count($entry_list));
$this->addMsg($this->getObjectPrefix(), $wrapper);
}
示例12: initService
public function initService($serviceId, $serviceName, $actionName)
{
parent::initService($serviceId, $serviceName, $actionName);
myPartnerUtils::addPartnerToCriteria(new DwhHourlyPartnerPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
}
示例13: __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) . "]");
}
示例14: listAction
/**
* List metadata objects by filter and pager
*
* @action list
* @param KalturaMetadataFilter $filter
* @param KalturaFilterPager $pager
* @return KalturaMetadataListResponse
*/
function listAction(KalturaMetadataFilter $filter = null, KalturaFilterPager $pager = null)
{
if (!$filter) {
$filter = new KalturaMetadataFilter();
}
if (kEntitlementUtils::getEntitlementEnforcement() && (is_null($filter->objectIdIn) && is_null($filter->objectIdEqual))) {
throw new KalturaAPIException(MetadataErrors::MUST_FILTER_ON_OBJECT_ID);
}
$entryIds = null;
if ($filter->metadataObjectTypeEqual == MetadataObjectType::ENTRY) {
if ($filter->objectIdEqual) {
$entryIds = array($filter->objectIdEqual);
} else {
if ($filter->objectIdIn) {
$entryIds = explode(',', $filter->objectIdIn);
}
}
}
if (is_null($entryIds)) {
myPartnerUtils::addPartnerToCriteria(new MetadataPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
} else {
$entryIds = entryPeer::filterEntriesByPartnerOrKalturaNetwork($entryIds, $this->getPartnerId());
$filter->objectIdEqual = null;
$filter->objectIdIn = implode(',', $entryIds);
}
$metadataFilter = new MetadataFilter();
$filter->toObject($metadataFilter);
$c = new Criteria();
$metadataFilter->attachToCriteria($c);
if ($entryIds === array()) {
$c->addAnd(MetadataPeer::OBJECT_ID, array(), Criteria::IN);
}
$count = MetadataPeer::doCount($c);
if (!$pager) {
$pager = new KalturaFilterPager();
}
$pager->attachToCriteria($c);
$list = MetadataPeer::doSelect($c);
$response = new KalturaMetadataListResponse();
$response->objects = KalturaMetadataArray::fromDbArray($list);
$response->totalCount = $count;
return $response;
}
示例15: applyPartnerFilterForClassNoKalturaNetwork
protected function applyPartnerFilterForClassNoKalturaNetwork($peer)
{
if ($this->getPartner()) {
$partner_id = $this->getPartner()->getId();
} else {
$partner_id = -1;
}
myPartnerUtils::addPartnerToCriteria($peer, $partner_id, $this->private_partner_data, $this->partnerGroup(), null);
}