如何从CATSSession对象访问用户ID?

时间:2018-08-22 12:36:24

标签: php arrays object

我有以下代码行

<?php
    $userobject = $_SESSION[CATS];
    print_r($userobject);
?>

以这种方式给我一个输出。

CATSSession Object ( [_siteID:CATSSession:private] => 1 [_userID:CATSSession:private] => 1262 [_siteCompanyID:CATSSession:private] => -1 [_userLoginID:CATSSession:private] => 184 [_accessLevel:CATSSession:private] => 200 [_realAccessLevel:CATSSession:private] => 200 [_isLoggedIn:CATSSession:private] => 1 [_isDemo:CATSSession:private] => [_isASP:CATSSession:private] => [_isFree:CATSSession:private] => [_isHrMode:CATSSession:private] => [_accountActive:CATSSession:private] => 1 [_accountDeleted:CATSSession:private] => [_siteName:CATSSession:private] => toppersedge.com [_unixName:CATSSession:private] => [_username:CATSSession:private] => savita [_password:CATSSession:private] => 6a8ce6560ef2e1bb577447dacc710fa7 [_firstName:CATSSession:private] => savita [_lastName:CATSSession:private] => savita [_email:CATSSession:private] => savita@toppersedge.com [_ip:CATSSession:private] => ::1 [_userAgent:CATSSession:private] => Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 [_userLicenses:CATSSession:private] => 0 [_loginError:CATSSession:private] => [_checkBoxes:CATSSession:private] => Array ( ) [_dropdowns:CATSSession:private] => Array ( ) [_categories:CATSSession:private] => Array ( [0] => ) [_startTime:CATSSession:private] => 0.53573800 1534941193 [_endTime:CATSSession:private] => 0.10456100 1534941134 [_backupDirectory:CATSSession:private] => [_storedBuild:CATSSession:private] => 0 [_timeZoneOffset:CATSSession:private] => 1 [_timeZone:CATSSession:private] => 6 [_dateDMY:CATSSession:private] => 1 [_pipelineEntriesPerPage:CATSSession:private] => 15 [_storedData:CATSSession:private] => Array ( ) [_storedValues:CATSSession:private] => Array ( ) [_MRU:CATSSession:private] => MRU Object ( [_userID:protected] => 1262 [_siteID:protected] => 1 ) [_dataGridColumnPreferences:CATSSession:private] => Array ( [37e73d402d9ab7354df8059c91457059] => Array ( [rangeStart] => 0 [maxResults] => 15 [filterVisible] => [sortBy] => dateModifiedSort [sortDirection] => DESC ) [64b156082b85b493104a8ae2ac3dcce1] => Array ( [rangeStart] => 0 [maxResults] => 15 [filterVisible] => [startDate] => [endDate] => [period] => DATE_SUB(CURDATE(), INTERVAL 1 MONTH) [sortBy] => dateCreatedSort [sortDirection] => DESC ) ) [_dataGridParameters:CATSSession:private] => Array ( ) [_isFirstTimeSetup:CATSSession:private] => [_isAgreedToLicense:CATSSession:private] => 1 [_isLocalizationConfigured:CATSSession:private] => [_loggedInDirectory:CATSSession:private] => [_canSeeEEOInfo] => [_loggedInScript] => /ATS [__dataGridColumnPreferences] => Array ( [home:ImportantPipelineDashboard] => Array ( [0] => Array ( [name] => First Name [width] => 85 ) [1] => Array ( [name] => Last Name [width] => 75 ) [2] => Array ( [name] => Status [width] => 75 ) [3] => Array ( [name] => Position [width] => 275 ) [4] => Array ( [name] => Company [width] => 210 ) [5] => Array ( [name] => Modified [width] => 80 ) ) [home:CallsDataGrid] => Array ( [0] => Array ( [name] => Time [width] => 90 ) [1] => Array ( [name] => Name [width] => 175 ) ) ) )

我只是想从对象中提取用户ID,该怎么办?

2 个答案:

答案 0 :(得分:5)

根据https://github.com/opencats/OpenCATS/blob/master/lib/Session.php的消息来源,您需要致电...

$userobject->getUserID();

答案 1 :(得分:2)

this.assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(name: new AssemblyName(AutoGenConst.DYNAMIC_ASSEMBLY_NAME), access: AssemblyBuilderAccess.RunAndCollect);

请参见https://github.com/opencats/OpenCATS/blob/master/lib/Session.php