本文整理汇总了PHP中UserInfo::getUserName方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::getUserName方法的具体用法?PHP UserInfo::getUserName怎么用?PHP UserInfo::getUserName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::getUserName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: write
public function write()
{
$userInfo = new UserInfo();
echo $userInfo->getUserName();
}
示例2: getUserData
/**
* Return choices of all the users.
* @param type $sDefaultChoiceOverrideID
* @param type $sRole
* @param type $oRemoveUser
* @return \raptor_datalayer_Choice
*/
public static function getUserData($sDefaultChoiceOverrideID = NULL, $sDefaultaChoiceText = NULL, $sRemoveUserName = NULL)
{
$oUserInfo = new UserInfo();
$aUserInfo = $oUserInfo->getAll();
$aList = array();
if ($sDefaultChoiceOverrideID !== NULL) {
$oC = new raptor_datalayer_Choice($sDefaultChoiceOverrideID, $sDefaultaChoiceText, "");
$oC->bIsDefault = true;
$aList[] = $oC;
}
foreach ($aUserInfo as $oUserInfo) {
if ($oUserInfo->getUserName() != $sRemoveUserName) {
$sLineLabel = $oUserInfo->getRealName();
$sLineID = $oUserInfo->getUserName();
$sCategory = $oUserInfo->getRolesText();
$oC = new raptor_datalayer_Choice($sLineLabel, $sLineID, $sCategory);
$oC->bIsDefault = $sDefaultChoiceOverrideID == $sLineID;
$aList[] = $oC;
}
}
return $aList;
}
示例3: getName
function __construct($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
}
//新代码,开放平台标准接口
interface UserInterface
{
function getUserName();
}
class UserInfo implements UserInterface
{
protected $user;
function __construct($user)
{
$this->user = $user;
}
public function getUserName()
{
return $this->user->getName();
}
}
$olduser = new User('d');
echo $olduser->getName() . "n";
$newuser = new UserInfo($olduser);
echo $newuser->getUserName() . "n";