当前位置: 首页>>代码示例>>PHP>>正文


PHP kuserPeer::getKuserByPartnerAndUid方法代码示例

本文整理汇总了PHP中kuserPeer::getKuserByPartnerAndUid方法的典型用法代码示例。如果您正苦于以下问题:PHP kuserPeer::getKuserByPartnerAndUid方法的具体用法?PHP kuserPeer::getKuserByPartnerAndUid怎么用?PHP kuserPeer::getKuserByPartnerAndUid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kuserPeer的用法示例。


在下文中一共展示了kuserPeer::getKuserByPartnerAndUid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $user_id = $this->getPM("user_id");
     $new_user_id = $this->getPM("new_user_id");
     $target_puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $user_id, true);
     if (!$target_puser_kuser) {
         $this->addError(APIErrors::INVALID_USER_ID, $user_id);
         return;
     }
     $new_puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $new_user_id, true);
     $kuser = kuserPeer::getKuserByPartnerAndUid($partner_id, $new_user_id);
     if ($new_puser_kuser || $kuser) {
         $this->addError(APIErrors::DUPLICATE_USER_BY_ID, $new_user_id);
         return;
     }
     $target_puser_kuser->setPuserId($new_user_id);
     $target_puser_kuser->save();
     PuserKuserPeer::removeFromCache($target_puser_kuser);
     $kuser = $target_puser_kuser->getKuser();
     $kuser->setPuserId($target_puser_kuser->getPuserId());
     $kuser->save();
     $wrapper = objectWrapperBase::getWrapperClass($target_puser_kuser, objectWrapperBase::DETAIL_LEVEL_DETAILED);
     $wrapper->removeFromCache("PuserKuser", $target_puser_kuser->getId());
     $this->addMsg("user", $wrapper);
 }
开发者ID:DBezemer,项目名称:server,代码行数:25,代码来源:updateuseridAction.class.php

示例2: toObject

 /**
  * @param CuePointFilter $cuePointFilter
  * @param array $propsToSkip
  * @return CuePointFilter
  */
 public function toObject($cuePointFilter = null, $propsToSkip = array())
 {
     if (!$cuePointFilter) {
         $cuePointFilter = new CuePointFilter();
     }
     if (isset($this->userIdEqual)) {
         $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $this->userIdEqual);
         if (!$dbKuser) {
             throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
         }
         $this->userIdEqual = $dbKuser->getId();
     }
     if (isset($this->userIdIn)) {
         $userIds = explode(",", $this->userIdIn);
         foreach ($userIds as $userId) {
             $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $userId);
             if (!$dbKuser) {
                 throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
             }
             $kuserIds = $dbKuser->getId() . ",";
         }
         $this->userIdIn = $kuserIds;
     }
     return parent::toObject($cuePointFilter, $propsToSkip);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:30,代码来源:KalturaCuePointFilter.php

示例3: setDefaultCriteriaFilter

 public static function setDefaultCriteriaFilter()
 {
     if (self::$s_criteria_filter == null) {
         self::$s_criteria_filter = new criteriaFilter();
     }
     $c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
     $c->addAnd(CuePointPeer::STATUS, CuePointStatus::DELETED, Criteria::NOT_EQUAL);
     if (self::$userContentOnly) {
         $puserId = kCurrentContext::$ks_uid;
         $partnerId = kCurrentContext::$ks_partner_id;
         if ($puserId && $partnerId) {
             $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $puserId);
             if (!$kuser) {
                 $kuser = kuserPeer::createKuserForPartner($partnerId, $puserId);
             }
             // Temporarily change user filter to (user==kuser OR cuepoint of type THUMB/CODE). Long term fix will be accomplished
             // by adding a public property on the cuepoint object and checking (user==kuser OR is public)
             //$c->addAnd(CuePointPeer::KUSER_ID, $kuser->getId());
             $criterionUserOrPublic = $c->getNewCriterion(CuePointPeer::KUSER_ID, $kuser->getId());
             $criterionUserOrPublic->addOr($c->getNewCriterion(self::IS_PUBLIC, true, Criteria::EQUAL));
             $criterionUserOrPublic->addTag(KalturaCriterion::TAG_USER_SESSION);
             $criterionUserOrPublic->addOr($c->getNewCriterion(CuePointPeer::TYPE, array(ThumbCuePointPlugin::getCuePointTypeCoreValue(ThumbCuePointType::THUMB), CodeCuePointPlugin::getCuePointTypeCoreValue(CodeCuePointType::CODE), AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)), Criteria::IN));
             $c->addAnd($criterionUserOrPublic);
         }
     }
     self::$s_criteria_filter->setFilter($c);
 }
开发者ID:panigh,项目名称:server,代码行数:27,代码来源:CuePointPeer.php

示例4: toFilter

 public function toFilter($partnerId)
 {
     $object = new ShortLinkFilter();
     if (!is_null($this->userIdEqual)) {
         $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $this->userIdEqual);
         if ($kuser) {
             $this->userIdEqual = $kuser->getId();
         } else {
             $this->userIdEqual = -1;
         }
         // no result will be returned when the user is missing
     }
     if (!is_null($this->userIdIn)) {
         $puserIds = explode(',', $this->userIdIn);
         $kusers = kuserPeer::getKuserByPartnerAndUids($partnerId, $puserIds);
         if (count($kusers)) {
             $kuserIds = array();
             foreach ($kusers as $kuser) {
                 $kuserIds[] = $kuser->getId();
             }
             $this->userIdIn = implode(',', $kuserIds);
         } else {
             $this->userIdIn = -1;
             // no result will be returned when the user is missing
         }
     }
     return parent::toObject($object);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:28,代码来源:KalturaShortLinkFilter.php

示例5: translateUserIds

 protected function translateUserIds()
 {
     if ($this->userIdCurrent == KalturaNullableBoolean::TRUE_VALUE) {
         if (kCurrentContext::$ks_kuser_id) {
             $this->userIdEqual = kCurrentContext::$ks_kuser_id;
         } else {
             $this->isPublicEqual = KalturaNullableBoolean::TRUE_VALUE;
         }
         $this->userIdCurrent = null;
     }
     if (isset($this->userIdEqual)) {
         $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $this->userIdEqual);
         if (!$dbKuser) {
             throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
         }
         $this->userIdEqual = $dbKuser->getId();
     }
     if (isset($this->userIdIn)) {
         $userIds = explode(",", $this->userIdIn);
         foreach ($userIds as $userId) {
             $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $userId);
             if (!$dbKuser) {
                 throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
             }
             $kuserIds = $dbKuser->getId() . ",";
         }
         $this->userIdIn = $kuserIds;
     }
 }
开发者ID:visomar,项目名称:server,代码行数:29,代码来源:KalturaCuePointFilter.php

示例6: deleteAction

 /**
  * delete by userId and groupId
  *
  * @action delete
  * @param string $userId
  * @param string $groupId
  */
 function deleteAction($userId, $groupId)
 {
     $partnerId = $this->getPartnerId();
     //verify kuser exists
     $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $userId);
     if (!$kuser) {
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID, $userId);
     }
     //verify group exists
     $kgroup = kuserPeer::getKuserByPartnerAndUid($partnerId, $groupId);
     if (!$kgroup) {
         //if the delete worker was triggered due to group deletion
         if (kCurrentContext::$master_partner_id != Partner::BATCH_PARTNER_ID) {
             throw new KalturaAPIException(KalturaErrors::GROUP_NOT_FOUND, $groupId);
         }
         kuserPeer::setUseCriteriaFilter(false);
         $kgroup = kuserPeer::getKuserByPartnerAndUid($partnerId, $groupId);
         kuserPeer::setUseCriteriaFilter(true);
         if (!$kgroup) {
             throw new KalturaAPIException(KalturaErrors::GROUP_NOT_FOUND, $groupId);
         }
     }
     $dbKuserKgroup = KuserKgroupPeer::retrieveByKuserIdAndKgroupId($kuser->getId(), $kgroup->getId());
     if (!$dbKuserKgroup) {
         throw new KalturaAPIException(KalturaErrors::GROUP_USER_DOES_NOT_EXIST, $userId, $groupId);
     }
     $dbKuserKgroup->setStatus(KuserKgroupStatus::DELETED);
     $dbKuserKgroup->save();
     $groupUser = new KalturaGroupUser();
     $groupUser->fromObject($dbKuserKgroup);
 }
开发者ID:DBezemer,项目名称:server,代码行数:38,代码来源:GroupUserService.php

示例7: getFieldValue

 protected function getFieldValue(kScope $scope = null)
 {
     if (!$scope) {
         $scope = new kScope();
     }
     $kuser = kuserPeer::getKuserByPartnerAndUid($scope->getKs()->partner_id, $scope->getKs()->user);
     return $kuser->getEmail();
 }
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:kUserEmailContextField.php

示例8: setPuserId

 public function setPuserId($v)
 {
     $kuser = kuserPeer::getKuserByPartnerAndUid($this->getPartnerId(), $v);
     if (!$kuser) {
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
     }
     return $this->setKuserId($kuser->getId());
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:8,代码来源:Annotation.php

示例9: createPuserKuser

 /**
 	Returns newly created puser - after creating it's corresponding kuser.
 	If the puser_kuser already exists && $verify_not_exists==true , don't create a new one and return the existing one
 */
 public static function createPuserKuser($partner_id, $subp_id, $puser_id, $kuser_name, $puser_name, $create_kuser = false, $kuser = null)
 {
     $puser_kuser = self::retrieveByPartnerAndUid($partner_id, $subp_id, $puser_id, true);
     if (!$kuser) {
         $kuser = kuserPeer::getKuserByPartnerAndUid($partner_id, $puser_id, true);
         // don't create an existing kuser!
     }
     if ($puser_kuser) {
         if (!$create_kuser) {
             // if the puser_kuser already exists - don't re-create it
             $puser_kuser->exists = true;
             return $puser_kuser;
         } else {
             // puser_kuser exists but it's OK
             // this might be the case where we don't mind creating a new one each time
         }
     } else {
         $puser_kuser = new PuserKuser();
     }
     $c = new Criteria();
     $c->add(self::PARTNER_ID, $partner_id);
     $c->add(self::PUSER_ID, $puser_id);
     $partner_puser_kuser = self::doSelectOne($c);
     if ($kuser !== null) {
         $kuser_id = $kuser->getId();
     } else {
         if ($partner_puser_kuser) {
             $kuser_id = $partner_puser_kuser->getKuserId();
             $kuser = kuserPeer::retrieveByPK($kuser_id);
         } else {
             // create kuser for this puser
             $kuser = new kuser();
             $kuser->setScreenName($kuser_name);
             list($firstName, $lastName) = kString::nameSplit($kuser_name);
             $kuser->setFirstName($firstName);
             $kuser->setLastName($lastName);
             $kuser->setPartnerId($partner_id);
             // set puserId for forward compatibility with PS3
             $kuser->setPuserId($puser_id);
             $kuser->setStatus(KuserStatus::ACTIVE);
             // so he won't appear in the search
             $kuser->save();
             $kuser_id = $kuser->getId();
         }
     }
     $puser_kuser->setPartnerId($partner_id);
     $puser_kuser->setSubpId($subp_id);
     $puser_kuser->setPuserId($puser_id);
     $puser_kuser->setKuserId($kuser_id);
     $puser_kuser->setPuserName($puser_name);
     $puser_kuser->save();
     $puser_kuser->setkuser($kuser);
     return $puser_kuser;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:58,代码来源:PuserKuserPeer.php

示例10: setPuserId

 /**
  * @param string $v puser id
  * @param bool $isAdmin
  * @return CuePoint
  */
 public function setPuserId($puserId)
 {
     if (!$this->getPartnerId()) {
         throw new Exception("Partner id must be set in order to load puser [{$puserId}]");
     }
     $kuser = kuserPeer::getKuserByPartnerAndUid($this->getPartnerId(), $puserId, true);
     if (!$kuser) {
         $kuser = kuserPeer::createKuserForPartner($this->getPartnerId(), $puserId);
     }
     $this->setKuserId($kuser->getId());
 }
开发者ID:kubrickfr,项目名称:server,代码行数:16,代码来源:CuePoint.php

示例11: setPuserId

 /**
  * Set the puser id and the kuser id
  * If the kuser doesn't exist it will be created
  * @param string $puserId
  */
 public function setPuserId($puserId)
 {
     if (!$this->getPartnerId()) {
         throw new Exception("Partner id must be set in order to load puser [{$puserId}]");
     }
     $this->puserId = $puserId;
     $kuser = kuserPeer::getKuserByPartnerAndUid($this->getPartnerId(), $puserId, true);
     if (!$kuser) {
         $isAdmin = kCurrentContext::$is_admin_session;
         $kuser = kuserPeer::createKuserForPartner($this->getPartnerId(), $puserId, $isAdmin);
     }
     $this->setKuserId($kuser->getId());
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:18,代码来源:ShortLink.php

示例12: setPgroupId

 public function setPgroupId($pgroupId)
 {
     if (self::getPgroupId() == $pgroupId) {
         // same value - don't set for nothing
         return;
     }
     parent::setPgroupId($pgroupId);
     $partnerId = kCurrentContext::getCurrentPartnerId();
     $kgroup = kuserPeer::getKuserByPartnerAndUid($partnerId, $pgroupId, false, KuserType::GROUP);
     if (!$kgroup) {
         throw new kCoreException("Invalid group Id [{$pgroupId}]", kCoreException::INVALID_USER_ID);
     }
     parent::setKgroupId($kgroup->getId());
 }
开发者ID:AdiTal,项目名称:server,代码行数:14,代码来源:KuserKgroup.php

示例13: toObject

 public function toObject($object_to_fill = null, $props_to_skip = array())
 {
     //No need to add objectId to result with status ERROR
     if ($this->status != KalturaBulkUploadResultStatus::ERROR) {
         $kuser = kuserPeer::getKuserByPartnerAndUid($this->partnerId, $this->userId);
         if (!$kuser) {
             throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
         }
         $categoryKuser = categoryKuserPeer::retrieveByCategoryIdAndKuserId($this->categoryId, $kuser->getId());
         if ($categoryKuser) {
             $this->objectId = $categoryKuser->getId();
         }
     }
     return parent::toObject($object_to_fill, $props_to_skip);
 }
开发者ID:DBezemer,项目名称:server,代码行数:15,代码来源:KalturaBulkUploadResultCategoryUser.php

示例14: setPuserId

 public function setPuserId($puserId)
 {
     if (self::getPuserId() == $puserId) {
         // same value - don't set for nothing
         return;
     }
     parent::setPuserId($puserId);
     $partnerId = kCurrentContext::$partner_id ? kCurrentContext::$partner_id : kCurrentContext::$ks_partner_id;
     $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $puserId);
     if (!$kuser) {
         throw new kCoreException("Invalid user Id [{$puserId}]", kCoreException::INVALID_USER_ID);
     }
     parent::setKuserId($kuser->getId());
     parent::setScreenName($kuser->getScreenName());
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:categoryKuser.php

示例15: fixFilterUserId

 /**
  * The user_id is infact a puser_id and the kuser_id should be retrieved
  */
 protected function fixFilterUserId()
 {
     if ($this->userIdEqual !== null) {
         $kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::getCurrentPartnerId(), $this->userIdEqual);
         if ($kuser) {
             $this->userIdEqual = $kuser->getId();
         } else {
             $this->userIdEqual = -1;
         }
         // no result will be returned when the user is missing
     }
     if (!empty($this->userIdIn)) {
         $this->userIdIn = $this->preparePusersToKusersFilter($this->userIdIn);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:18,代码来源:KalturaUserEntryFilter.php


注:本文中的kuserPeer::getKuserByPartnerAndUid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。