本文整理汇总了PHP中kuserPeer::getKuserByPartnerAndUids方法的典型用法代码示例。如果您正苦于以下问题:PHP kuserPeer::getKuserByPartnerAndUids方法的具体用法?PHP kuserPeer::getKuserByPartnerAndUids怎么用?PHP kuserPeer::getKuserByPartnerAndUids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kuserPeer
的用法示例。
在下文中一共展示了kuserPeer::getKuserByPartnerAndUids方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: validateMetadataObjects
public static function validateMetadataObjects($profileField, $objectIds, &$errorMessage)
{
/** @var MetadataProfileField $profileField */
$partnerId = kCurrentContext::getCurrentPartnerId();
$dbObjects = kuserPeer::getKuserByPartnerAndUids($partnerId, $objectIds);
if (count($dbObjects) != count($objectIds)) {
$errorMessage = 'One of the following objects: ' . implode(', ', $objectIds) . ' was not found';
return false;
}
return true;
}
示例3: preparePusersToKusersFilter
private function preparePusersToKusersFilter($puserIdsCsv)
{
$kuserIdsArr = array();
$puserIdsArr = explode(',', $puserIdsCsv);
$kuserArr = kuserPeer::getKuserByPartnerAndUids(kCurrentContext::getCurrentPartnerId(), $puserIdsArr);
foreach ($kuserArr as $kuser) {
$kuserIdsArr[] = $kuser->getId();
}
if (!empty($kuserIdsArr)) {
return implode(',', $kuserIdsArr);
}
return -1;
// no result will be returned if no puser exists
}
示例4: getListResponse
public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
{
if (!is_null($this->isAnonymous)) {
if (KalturaNullableBoolean::toBoolean($this->isAnonymous) === false) {
if ($this->userIdNotIn == null) {
$anonKuserIds = "";
$anonKusers = kuserPeer::getKuserByPartnerAndUids(kCurrentContext::getCurrentPartnerId(), array('', 0));
foreach ($anonKusers as $anonKuser) {
$anonKuserIds .= $anonKuser->getKuserId() . ",";
}
$this->userIdNotIn = $anonKuserIds;
}
}
}
return parent::getListResponse($pager, $responseProfile);
}
示例5: toObject
/**
* @param AuditTrailFilter $auditTrailFilter
* @param array $propsToSkip
* @return AuditTrailFilter
*/
public function toObject($auditTrailFilter = null, $propsToSkip = array())
{
if (isset($this->userIdEqual)) {
$kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $this->userIdEqual, true);
if ($kuser) {
$this->userIdEqual = $kuser->getId();
}
}
if (isset($this->userIdIn)) {
$kusers = kuserPeer::getKuserByPartnerAndUids(kCurrentContext::$ks_partner_id, $this->userIdIn);
$kuserIds = array();
foreach ($kusers as $kuser) {
$kuserIds[] = $kuser->getId();
}
$this->userIdIn = implode(',', $kuserIds);
}
return parent::toObject($auditTrailFilter, $propsToSkip);
}
示例6: toObject
public function toObject($obj = null, $props_to_skip = array())
{
if (!$obj) {
$obj = new kCategoryKuserAdvancedFilter();
}
if (!$this->memberIdEq && !$this->memberIdIn) {
throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'memberIdEq,memberIdIn');
}
if (!$this->memberPermissionsMatchOr && !$this->memberPermissionsMatchAnd) {
throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'memberIdEq,memberIdIn');
}
if ($this->memberIdEq) {
$kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::getCurrentPartnerId(), $this->memberIdEq);
if (!$kuser) {
throw new KalturaAPIException(KalturaErrors::USER_NOT_FOUND);
}
$kuserIds = array($kuser->getId());
// retrieve categories that the user is a member by a group.
$kgroupIds = KuserKgroupPeer::retrieveKgroupIdsByKuserId($kuser->getId());
if (!is_null($kgroupIds) && is_array($kgroupIds)) {
$kuserIds = array_merge($kgroupIds, $kuserIds);
}
$obj->setMemberIdIn($kuserIds);
}
if ($this->memberIdIn) {
$kusers = kuserPeer::getKuserByPartnerAndUids(kCurrentContext::getCurrentPartnerId(), explode(',', $this->memberIdIn));
$kuserIds = array();
if (!$kusers || !count($kusers)) {
throw new KalturaAPIException(KalturaErrors::USER_NOT_FOUND);
}
foreach ($kusers as $kuser) {
$kuserIds[] = $kuser->getId();
}
// retrieve categories that the users are members by a group.
$kgroupIds = KuserKgroupPeer::retrieveKgroupIdsByKuserIds($kuserIds);
if (!is_null($kgroupIds) && is_array($kgroupIds)) {
$kuserIds = array_merge($kgroupIds, $kuserIds);
}
$obj->setMemberIdIn($kuserIds);
}
return parent::toObject($obj, $props_to_skip);
}
示例7: toObject
public function toObject($object_to_fill = null, $props_to_skip = array())
{
if ($this->metadataObjectTypeEqual == KalturaMetadataObjectType::USER) {
if ($this->objectIdEqual) {
$kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::getCurrentPartnerId(), $this->objectIdEqual);
if ($kuser) {
$this->objectIdEqual = $kuser->getId();
}
}
if ($this->objectIdIn) {
$kusers = kuserPeer::getKuserByPartnerAndUids(kCurrentContext::getCurrentPartnerId(), explode(',', $this->objectIdIn));
$kusersIds = array();
foreach ($kusers as $kuser) {
$kusersIds[] = $kuser->getId();
}
$this->objectIdIn = implode(',', $kusersIds);
}
}
return parent::toObject($object_to_fill, $props_to_skip);
}
示例8: getAnonymousKuserIds
/**
* @param $partnerID
*/
protected function getAnonymousKuserIds($partnerID)
{
$anonKuserIds = array();
$anonKusers = kuserPeer::getKuserByPartnerAndUids($partnerID, array('', 0));
foreach ($anonKusers as $anonKuser) {
$anonKuserIds[] = $anonKuser->getKuserId();
}
return $anonKuserIds;
}