本文整理汇总了PHP中myPartnerUtils::getPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP myPartnerUtils::getPrefix方法的具体用法?PHP myPartnerUtils::getPrefix怎么用?PHP myPartnerUtils::getPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::getPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createUserOnDemand
protected function createUserOnDemand($partner_id, $subp_id, $puser_id, $puser_kuser, $kuser = null)
{
// make sure the user [puser_kuser + kuser] exists according to addUserOnDemand
// TODO - remove dead code
//$create_user_on_demand = $this->addUserOnDemand();
$create_user_on_demand = $this->addUserOnDemand2();
$create_user = false;
if ($puser_kuser == null) {
if ($create_user_on_demand == self::CREATE_USER_FALSE) {
$create_user = false;
} elseif ($create_user_on_demand == self::CREATE_USER_FORCE) {
$create_user = true;
} elseif ($create_user_on_demand == self::CREATE_USER_FROM_PARTNER_SETTINGS) {
$partner = PartnerPeer::retrieveByPK($partner_id);
$create_user = $partner->getCreateUserOnDemand();
}
}
if ($create_user) {
// prefer the user_screenName on user_name
$user_name = $this->getP("user_screenName", $this->getP("user_name"));
if (!$user_name) {
$puser_name = $kuser_name = myPartnerUtils::getPrefix($partner_id) . $puser_id;
} else {
$puser_name = $kuser_name = $user_name;
}
$puser_kuser = PuserKuserPeer::createPuserKuser($partner_id, $subp_id, $puser_id, $kuser_name, $puser_name, false, $kuser);
}
return $puser_kuser;
}
示例2: getLoggedInUserId
protected function getLoggedInUserId()
{
if ($this->partner_id) {
// this part overhere should be in a more generic place - part of the services
$ks = "";
// TODO - for now ignore the session
$valid = true;
// ( 0 >= kSessionUtils::validateKSession ( $this->partner_id , $this->uid , $this->ks_str ,&$ks ) );
if ($valid) {
$puser_id = $this->uid;
// actually the better user indicator will be placed in the ks - TODO - use it !!
// $puser_id = $ks->user;
$kuser_name = $puser_name = $this->getP("user_name");
if (!$puser_name) {
$kuser_name = myPartnerUtils::getPrefix($this->partner_id) . $puser_id;
}
// will return the existing one if any, will create is none
$puser_kuser = PuserKuserPeer::createPuserKuser($this->partner_id, $this->subp_id, $puser_id, $kuser_name, $puser_name, false);
$likuser_id = $puser_kuser->getKuserId();
// from now on - this will be considered the logged in user
return $likuser_id;
}
} else {
return parent::getLoggedInUserId();
}
}