本文整理匯總了PHP中UserInfo::getUserID方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserInfo::getUserID方法的具體用法?PHP UserInfo::getUserID怎麽用?PHP UserInfo::getUserID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserInfo
的用法示例。
在下文中一共展示了UserInfo::getUserID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getOrCreate
public static function getOrCreate(UserInfo $ui)
{
$db = Loader::db();
$petID = $db->GetOne('select petID from PermissionAccessEntityTypes where petHandle = \'user\'');
$peID = $db->GetOne('select pae.peID from PermissionAccessEntities pae inner join PermissionAccessEntityUsers paeg on pae.peID = paeg.peID where petID = ? and paeg.uID = ?', array($petID, $ui->getUserID()));
if (!$peID) {
$db->Execute("insert into PermissionAccessEntities (petID) values(?)", array($petID));
$peID = $db->Insert_ID();
Config::save('ACCESS_ENTITY_UPDATED', time());
$db->Execute('insert into PermissionAccessEntityUsers (peID, uID) values (?, ?)', array($peID, $ui->getUserID()));
}
return PermissionAccessEntity::getByID($peID);
}
示例2: getImagePath
/**
* gets the image path for a users avatar
* @param \UserInfo $uo
* @param bool $withNoCacheStr
* @return bool|string $src
*/
public function getImagePath($uo, $withNoCacheStr = true)
{
if (!$uo->hasAvatar()) {
return false;
}
$fsl = StorageLocation::getDefault();
$fs = $fsl->getFileSystemObject();
if ($fs->has(REL_DIR_FILES_AVATARS . '/' . $uo->getUserID() . '.jpg')) {
$configuration = $fsl->getConfigurationObject();
$src = $configuration->getPublicURLToFile(REL_DIR_FILES_AVATARS . '/' . $uo->getUserID() . '.jpg');
$cacheStr = "?" . time();
if ($withNoCacheStr) {
$src .= $cacheStr;
}
return $src;
}
}