本文整理汇总了PHP中UserInfo::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::getById方法的具体用法?PHP UserInfo::getById怎么用?PHP UserInfo::getById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::getById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: t
?>
</h1>
<?php
$friendsData = UsersFriends::getUsersFriendsData($profile->getUserID());
if (!$friendsData) {
?>
<div style="padding:16px 0px;">
<?php
echo t('No results found.');
?>
</div>
<?php
} else {
foreach ($friendsData as $friendsData) {
$friendUID = $friendsData['friendUID'];
$friendUI = UserInfo::getById($friendUID);
if (!is_object($friendUI)) {
?>
<div class="ccm-users-friend" style="margin-bottom:16px;">
<div style="float:left; width:100px;">
<?php
echo $av->outputNoAvatar();
?>
</div>
<div >
<?php
echo t('Unknown User');
?>
</div>
<div class="ccm-spacer"></div>
示例2: foreach
<?php
$downloadStatsCounter = 0;
foreach ($downloadStatistics as $download) {
$downloadStatsCounter++;
if ($downloadStatsCounter > 20) {
break;
}
?>
<tr>
<td>
<?php
$uID = intval($download['uID']);
if (!$uID) {
echo t('Anonymous');
} else {
$downloadUI = UserInfo::getById($uID);
if ($downloadUI instanceof UserInfo) {
echo $downloadUI->getUserName();
} else {
echo t('Deleted User');
}
}
?>
</td>
<td><?php
echo $dateHelper->formatSpecial('FILE_DOWNLOAD', $download['timestamp']);
?>
</td>
<td><?php
echo intval($download['fvID']);
?>
示例3: setProfile
protected function setProfile()
{
$u = new User();
$ui = UserInfo::getById($u->getUserId());
$ui->setAttribute("{$this->network}_id", $this->user->identifier);
if ($ui->getAttribute('first_name') == '') {
$ui->setAttribute('first_name', $this->user->firstName);
}
if ($ui->getAttribute('last_name') == '') {
$ui->setAttribute('last_name', $this->user->lastName);
}
$this->setPicture($ui);
if ($this->network == 'linkedin') {
$this->auth->api()->setResponseFormat('JSON');
$resp = $this->auth->api()->profile('~:(id,first-name,last-name,industry,positions)');
$profile = json_decode($resp['linkedin']);
if (UserAttributeKey::getByHandle('company')) {
$company = $profile->positions->values[0]->company->name;
$ui->setAttribute('company', $company);
}
if (UserAttributeKey::getByHandle('title')) {
$title = $profile->positions->values[0]->title;
$ui->setAttribute('title', $title);
}
}
}