本文整理汇总了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;
}
}