本文整理汇总了PHP中PartnerPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP PartnerPeer::retrieveByPK方法的具体用法?PHP PartnerPeer::retrieveByPK怎么用?PHP PartnerPeer::retrieveByPK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartnerPeer
的用法示例。
在下文中一共展示了PartnerPeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addXMLBulkUploadJob
/**
* Add bulk upload job
* @param DropFolder $folder
* @param DropFolderFile $leadDropFolderFile
* @throws Exception
*/
private function addXMLBulkUploadJob(DropFolder $folder, DropFolderFile $leadDropFolderFile)
{
/* @var $leadDropFolderFile FeedDropFolderFile */
KalturaLog::info('Adding BulkUpload job');
try {
$coreBulkUploadType = BulkUploadXmlPlugin::getBulkUploadTypeCoreValue(BulkUploadXmlType::XML);
$objectId = $leadDropFolderFile->getId();
$objectType = DropFolderXmlBulkUploadPlugin::getBatchJobObjectTypeCoreValue(DropFolderBatchJobObjectType::DROP_FOLDER_FILE);
$partner = PartnerPeer::retrieveByPK($folder->getPartnerId());
$data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
/* @var $data kBulkUploadJobData */
$data->setUploadedBy(kDropFolderXmlEventsConsumer::UPLOADED_BY);
KalturaLog::info("Feed XML path: " . $leadDropFolderFile->getFeedXmlPath());
$data->setFilePath($leadDropFolderFile->getFeedXmlPath());
$data->setFileName(basename($data->getFilePath()) . '.xml');
$objectData = new kBulkUploadEntryData();
KalturaLog::info('Conversion profile id: ' . $folder->getConversionProfileId());
$objectData->setConversionProfileId($folder->getConversionProfileId());
$data->setObjectData($objectData);
$job = kJobsManager::addBulkUploadJob($partner, $data, $coreBulkUploadType, $objectId, $objectType);
$this->setFileToProcessing($leadDropFolderFile);
return $job;
} catch (Exception $e) {
KalturaLog::err("Error adding BulkUpload job -" . $e->getMessage());
throw new Exception(DropFolderXmlBulkUploadPlugin::ERROR_ADDING_BULK_UPLOAD_MESSAGE, DropFolderXmlBulkUploadPlugin::getErrorCodeCoreValue(DropFolderXmlBulkUploadErrorCode::ERROR_ADDING_BULK_UPLOAD));
}
}
示例2: execute
public function execute()
{
$this->forceSystemAuthentication();
myDbHelper::$use_alternative_con = null;
$partnerId = $this->getRequestParameter("partnerId", null);
$uiConfId = $this->getRequestParameter("uiConfId", null);
$page = $this->getRequestParameter("page", 1);
if ($partnerId !== null && $partnerId !== "") {
$pageSize = 50;
$c = new Criteria();
$c->add(widgetPeer::PARTNER_ID, $partnerId);
if ($uiConfId) {
$c->add(widgetPeer::UI_CONF_ID, $uiConfId);
}
$c->addDescendingOrderByColumn(widgetPeer::CREATED_AT);
$total = widgetPeer::doCount($c);
$lastPage = ceil($total / $pageSize);
$c->setOffset(($page - 1) * $pageSize);
$c->setLimit($pageSize);
$widgets = widgetPeer::doSelect($c);
} else {
$total = 0;
$lastPage = 0;
$widgets = array();
}
$this->uiConfId = $uiConfId;
$this->page = $page;
$this->lastPage = $lastPage;
$this->widgets = $widgets;
$this->partner = PartnerPeer::retrieveByPK($partnerId);
$this->partnerId = $partnerId;
}
示例3: addAction
/**
* Allows you to add a new DrmProfile object
*
* @action add
* @param KalturaDrmProfile $drmProfile
* @return KalturaDrmProfile
*
* @throws KalturaErrors::PLUGIN_NOT_AVAILABLE_FOR_PARTNER
* @throws KalturaErrors::INVALID_PARTNER_ID
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
* @throws DrmErrors::ACTIVE_PROVIDER_PROFILE_ALREADY_EXIST
*/
public function addAction(KalturaDrmProfile $drmProfile)
{
// check for required parameters
$drmProfile->validatePropertyNotNull('name');
$drmProfile->validatePropertyNotNull('status');
$drmProfile->validatePropertyNotNull('provider');
$drmProfile->validatePropertyNotNull('partnerId');
// validate values
if (!PartnerPeer::retrieveByPK($drmProfile->partnerId)) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $drmProfile->partnerId);
}
if (!DrmPlugin::isAllowedPartner($drmProfile->partnerId)) {
throw new KalturaAPIException(KalturaErrors::PLUGIN_NOT_AVAILABLE_FOR_PARTNER, DrmPlugin::getPluginName(), $drmProfile->partnerId);
}
$dbDrmProfile = $drmProfile->toInsertableObject();
if (DrmProfilePeer::retrieveByProvider($dbDrmProfile->getProvider())) {
throw new KalturaAPIException(DrmErrors::ACTIVE_PROVIDER_PROFILE_ALREADY_EXIST, $drmProfile->provider);
}
// save in database
$dbDrmProfile->save();
// return the saved object
$drmProfile = KalturaDrmProfile::getInstanceByType($dbDrmProfile->getProvider());
$drmProfile->fromObject($dbDrmProfile, $this->getResponseProfile());
return $drmProfile;
}
示例4: objectChanged
public function objectChanged(BaseObject $object, array $modifiedColumns)
{
/* @var $object Permission */
$partner = PartnerPeer::retrieveByPK($object->getPartnerId());
$this->partnerPermissionEnabled($partner);
return true;
}
示例5: addAction
/**
* Add new Syndication Feed
*
* @action add
* @param KalturaBaseSyndicationFeed $syndicationFeed
* @return KalturaBaseSyndicationFeed
*/
public function addAction(KalturaBaseSyndicationFeed $syndicationFeed)
{
$syndicationFeed->validatePlaylistId();
if ($syndicationFeed instanceof KalturaGenericXsltSyndicationFeed) {
$syndicationFeed->validateXslt();
$syndicationFeedDB = new genericSyndicationFeed();
$syndicationFeedDB->setVersion(1);
} else {
$syndicationFeedDB = new syndicationFeed();
}
$syndicationFeed->partnerId = $this->getPartnerId();
$syndicationFeed->status = KalturaSyndicationFeedStatus::ACTIVE;
$syndicationFeed->toObject($syndicationFeedDB);
$syndicationFeedDB->save();
if ($syndicationFeed->addToDefaultConversionProfile) {
$partner = PartnerPeer::retrieveByPK($this->getPartnerId());
$c = new Criteria();
$c->addAnd(flavorParamsConversionProfilePeer::CONVERSION_PROFILE_ID, $partner->getDefaultConversionProfileId());
$c->addAnd(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $syndicationFeed->flavorParamId);
$is_exist = flavorParamsConversionProfilePeer::doCount($c);
if (!$is_exist || $is_exist === 0) {
$fpc = new flavorParamsConversionProfile();
$fpc->setConversionProfileId($partner->getDefaultConversionProfileId());
$fpc->setFlavorParamsId($syndicationFeed->flavorParamId);
$fpc->save();
}
}
if ($syndicationFeed instanceof KalturaGenericXsltSyndicationFeed) {
$key = $syndicationFeedDB->getSyncKey(genericSyndicationFeed::FILE_SYNC_SYNDICATION_FEED_XSLT);
kFileSyncUtils::file_put_contents($key, $syndicationFeed->xslt);
}
$syndicationFeed->fromObject($syndicationFeedDB);
return $syndicationFeed;
}
示例6: addAction
/**
* Allows you to add a new DrmPolicy object
*
* @action add
* @param KalturaDrmPolicy $drmPolicy
* @return KalturaDrmPolicy
*
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
*/
public function addAction(KalturaDrmPolicy $drmPolicy)
{
// check for required parameters
$drmPolicy->validatePropertyNotNull('name');
$drmPolicy->validatePropertyNotNull('status');
$drmPolicy->validatePropertyNotNull('provider');
$drmPolicy->validatePropertyNotNull('systemName');
$drmPolicy->validatePropertyNotNull('scenario');
$drmPolicy->validatePropertyNotNull('partnerId');
// validate values
$drmPolicy->validatePolicy();
if (!PartnerPeer::retrieveByPK($drmPolicy->partnerId)) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $drmPolicy->partnerId);
}
if (!DrmPlugin::isAllowedPartner($drmPolicy->partnerId)) {
throw new KalturaAPIException(KalturaErrors::PLUGIN_NOT_AVAILABLE_FOR_PARTNER, DrmPlugin::getPluginName(), $drmPolicy->partnerId);
}
if (DrmPolicyPeer::retrieveBySystemName($drmPolicy->systemName)) {
throw new KalturaAPIException(DrmErrors::DRM_POLICY_DUPLICATE_SYSTEM_NAME, $drmPolicy->systemName);
}
// save in database
$dbDrmPolicy = $drmPolicy->toInsertableObject();
$dbDrmPolicy->save();
// return the saved object
$drmPolicy = KalturaDrmPolicy::getInstanceByType($dbDrmPolicy->getProvider());
$drmPolicy->fromObject($dbDrmPolicy, $this->getResponseProfile());
return $drmPolicy;
}
示例7: getClientNotificationAction
/**
* Return the notifications for a specific entry id and type
*
* @action getClientNotification
* @param string $entryId
* @param KalturaNotificationType $type
* @return KalturaClientNotification
*/
function getClientNotificationAction($entryId, $type)
{
// in case of a multirequest, a mediaService.addFromUploadedFile may fail and therefore the resulting entry id will be empty
// in such a case return immidiately without looking for the notification
if ($entryId == '') {
throw new KalturaAPIException(KalturaErrors::NOTIFICATION_FOR_ENTRY_NOT_FOUND, $entryId);
}
$notifications = BatchJobPeer::retrieveByEntryIdAndType($entryId, BatchJobType::NOTIFICATION, $type);
// FIXME: throw error if not found
if (count($notifications) == 0) {
throw new KalturaAPIException(KalturaErrors::NOTIFICATION_FOR_ENTRY_NOT_FOUND, $entryId);
}
$notification = $notifications[0];
$partnerId = $this->getPartnerId();
$nofication_config_str = null;
list($nofity, $nofication_config_str) = myPartnerUtils::shouldNotify($partnerId);
if (!$nofity) {
return new KalturaClientNotification();
}
$nofication_config = myNotificationsConfig::getInstance($nofication_config_str);
$nofity_send_type = $nofication_config->shouldNotify($type);
if ($nofity_send_type != myNotificationMgr::NOTIFICATION_MGR_SEND_SYNCH && $nofity_send_type != myNotificationMgr::NOTIFICATION_MGR_SEND_BOTH) {
return new KalturaClientNotification();
}
$partner = PartnerPeer::retrieveByPK($partnerId);
list($url, $signatureKey) = myNotificationMgr::getPartnerNotificationInfo($partner);
list($params, $rawSignature) = myNotificationMgr::prepareNotificationData($url, $signatureKey, $notification, null);
$serializedParams = http_build_query($params, "", "&");
$result = new KalturaClientNotification();
$result->url = $url;
$result->data = $serializedParams;
return $result;
}
示例8: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$allow_empty = $this->getP("allow_empty_field", false);
if ($allow_empty == "false" || $allow_empty === 0) {
$allow_empty = false;
}
$partner = new Partner();
$obj_wrapper = objectWrapperBase::getWrapperClass($partner, 0);
$updateable_fields = $obj_wrapper->getUpdateableFields();
// TODO - use fillObjectFromMapOrderedByFields instead
$fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $partner, "partner_", $updateable_fields, BasePeer::TYPE_PHPNAME, $allow_empty);
// check that mandatory fields were set
// TODO
if (count($fields_modified) > 0) {
$target_partner = PartnerPeer::retrieveByPK($partner_id);
if ($partner && $target_partner) {
if (@$fields_modified["adminEmail"] && $target_partner->getAdminEmail() != $fields_modified["adminEmail"]) {
myPartnerUtils::emailChangedEmail($partner_id, $target_partner->getAdminEmail(), $fields_modified["adminEmail"], $target_partner->getName(), PartnerPeer::KALTURAS_PARTNER_EMAIL_CHANGE);
}
$partner->setType($target_partner->getType());
baseObjectUtils::fillObjectFromObject($updateable_fields, $partner, $target_partner, baseObjectUtils::CLONE_POLICY_PREFER_NEW, null, BasePeer::TYPE_PHPNAME, $allow_empty);
$target_partner->save();
$this->addMsg("partner", objectWrapperBase::getWrapperClass($target_partner, objectWrapperBase::DETAIL_LEVEL_DETAILED));
$this->addDebug("added_fields", $fields_modified);
} else {
$this->addError(APIErrors::UNKNOWN_PARTNER_ID);
}
} else {
$this->addError(APIErrors::NO_FIELDS_SET_FOR_PARTNER);
}
}
示例9: execute
public function execute()
{
$ksStr = $this->getP("ks");
if ($ksStr) {
$ksObj = null;
try {
$ksObj = ks::fromSecureString($ksStr);
} catch (Exception $e) {
}
if ($ksObj) {
$partner = PartnerPeer::retrieveByPK($ksObj->partner_id);
if (!$partner) {
KExternalErrors::dieError(KExternalErrors::PARTNER_NOT_FOUND);
}
if (!$partner->validateApiAccessControl()) {
KExternalErrors::dieError(KExternalErrors::SERVICE_ACCESS_CONTROL_RESTRICTED);
}
$ksObj->kill();
}
KalturaLog::info("Killing session with ks - [{$ksStr}], decoded - [" . base64_decode($ksStr) . "]");
} else {
KalturaLog::err('logoutAction called with no KS');
}
setcookie('pid', "", 0, "/");
setcookie('subpid', "", 0, "/");
setcookie('kmcks', "", 0, "/");
return sfView::NONE;
//redirection to kmc/kmc is done from java script
}
示例10: purgeAssetFromEdgeCast
private static function purgeAssetFromEdgeCast(asset $asset)
{
// get partner
$partnerId = $asset->getPartnerId();
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
KalturaLog::err('Cannot find partner with id [' . $partnerId . ']');
return false;
}
$mediaType = $asset instanceof thumbAsset ? self::EDGE_SERVICE_HTTP_SMALL_OBJECT_MEDIA_TYPE : self::EDGE_SERVICE_HTTP_LARGE_OBJECT_MEDIA_TYPE;
$mediaTypePathList = array();
try {
$mediaTypePathList[] = array('MediaType' => $mediaType, 'MediaPath' => $asset->getDownloadUrl());
// asset download url
} catch (Exception $e) {
KalturaLog::err('Cannot get asset URL for asset id [' . $asset->getId() . '] - ' . $e->getMessage());
}
if ($asset instanceof flavorAsset) {
// get a list of all URLs leading to the asset for purging
$subPartnerId = $asset->getentry()->getSubpId();
$partnerPath = myPartnerUtils::getUrlForPartner($partnerId, $subPartnerId);
$assetId = $asset->getId();
$serveFlavorUrl = "{$partnerPath}/serveFlavor/entryId/" . $asset->getEntryId() . "/flavorId/{$assetId}" . '*';
// * wildcard should delete all serveFlavor urls
$hosts = array($partner->getCdnHost(), $partner->getRtmpUrl(), $partner->getIisHost());
foreach ($hosts as $host) {
if (!empty($host)) {
$mediaTypePathList[] = array('MediaType' => $mediaType, 'MediaPath' => $host . $serveFlavorUrl);
}
}
}
return self::purgeFromEdgeCast($mediaTypePathList, $partner);
}
示例11: execute
public function execute()
{
$this->getResponse()->setHttpHeader("Content-Type", "application/x-javascript");
$kshow_id = $this->getRequestParameter('kshow_id', 0);
$uid = kuser::ANONYMOUS_PUSER_ID;
$kshow = kshowPeer::retrieveByPK($kshow_id);
if (!$kshow) {
return sfView::ERROR;
}
// kshow_id might be a string (something like "15483str") but it will be returned using retriveByPK anyways
// lets make sure we pass just the id to the contribution wizard
$kshow_id = $kshow->getId();
$partner_id = $kshow->getPartnerId();
$partner = PartnerPeer::retrieveByPK($partner_id);
$subp_id = $kshow->getSubpId();
$partner_secret = $partner->getSecret();
$partner_name = $partner->getPartnerName();
$kaltura_services = new startsessionAction();
$kaltura_services->setInputParams(array("format" => kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_ARRAY, "partner_id" => $partner_id, "subp_id" => $subp_id, "uid" => $uid, "secret" => $partner_secret));
$result = $kaltura_services->internalExecute();
$this->ks = @$result["result"]["ks"];
$this->widget_host = requestUtils::getHost();
$this->kshow_id = $kshow_id;
$this->uid = $uid;
$this->partner_id = $partner_id;
$this->subp_id = $subp_id;
$this->partner_name = $partner_name;
return sfView::SUCCESS;
}
示例12: getAssetUrl
public static function getAssetUrl(asset $asset, $servePlayManifest = false, $playManifestClientTag = null, $storageId = null, $urlParameters = '')
{
$partner = PartnerPeer::retrieveByPK($asset->getPartnerId());
if (!$partner) {
return null;
}
$syncKey = $asset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$externalStorageUrl = self::getExternalStorageUrl($partner, $asset, $syncKey, $servePlayManifest, $playManifestClientTag, $storageId);
if ($externalStorageUrl) {
return $externalStorageUrl;
}
if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY) {
return null;
}
if ($asset instanceof flavorAsset && $servePlayManifest) {
$url = requestUtils::getApiCdnHost() . $asset->getPlayManifestUrl($playManifestClientTag, $storageId);
} else {
$urlManager = DeliveryProfilePeer::getDeliveryProfile($asset->getEntryId());
if ($asset instanceof flavorAsset) {
$urlManager->initDeliveryDynamicAttributes(null, $asset);
}
$profileAttributes = $urlManager->getDynamicAttributes();
$profileAttributes->setUrlParams($urlParameters);
$url = $urlManager->getFullAssetUrl($asset);
$url = preg_replace('/^https?:\\/\\//', '', $url);
$protocol = infraRequestUtils::getProtocol();
$deliveryProfileProtocols = $urlManager->getMediaProtocols();
if (!is_null($deliveryProfileProtocols) && !in_array($protocol, explode(',', $deliveryProfileProtocols))) {
$protocol = infraRequestUtils::PROTOCOL_HTTP;
}
$url = $protocol . "://" . $url;
}
return $url;
}
示例13: traceEnabled
/**
* @param BaseObject $object
* @return bool
*/
public static function traceEnabled($partnerId, AuditTrail $auditTrail = null)
{
if (is_null($partnerId)) {
KalturaLog::info("Partner id is null");
return false;
}
if (!isset(self::$cachedPartnerEnabled[$partnerId])) {
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
KalturaLog::info("Partner not found");
return false;
}
if (!$partner->getPluginEnabled(AuditPlugin::PLUGIN_NAME)) {
KalturaLog::info("Partner audit trail is disabled");
self::$cachedPartnerEnabled[$partnerId] = false;
} else {
self::$cachedPartnerEnabled[$partnerId] = true;
}
}
// validate only partner
if (is_null($auditTrail)) {
return self::$cachedPartnerEnabled[$partnerId];
}
$auditTrailConfig = self::getAuditTrailConfig($partnerId, $auditTrail->getObjectType());
if (is_null($auditTrailConfig)) {
KalturaLog::info("Audit trail config not found");
return false;
}
return $auditTrailConfig->actionEnabled($auditTrail->getAction());
}
示例14: isAllowedPartner
public static function isAllowedPartner($partnerId)
{
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
return false;
}
return $partner->getPluginEnabled(self::PLUGIN_NAME);
}
示例15: isAllowedPartner
public static function isAllowedPartner($partnerId)
{
if (in_array($partnerId, array(Partner::ADMIN_CONSOLE_PARTNER_ID, Partner::BATCH_PARTNER_ID))) {
return true;
}
$partner = PartnerPeer::retrieveByPK($partnerId);
return $partner->getPluginEnabled(self::PLUGIN_NAME);
}