1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
user.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Forum\Comments;
4
5
use \Bitrix\Forum;
6
use Bitrix\Main\Engine\CurrentUser;
7
use CUser;
8
9
class
User
10
{
11
protected
?
int
$id
= 0;
12
private
static
$groups;
13
protected
$forumUser
=
null
;
14
15
public
function
__construct
(
int
$id
)
16
{
17
$user
= CurrentUser::get();
18
if
(
$id
=== (
int
)
$user
->getId())
19
{
20
$this->
id
= $id;
21
if
(empty(self::$groups[
$id
]))
22
{
23
self::$groups[
$id
] =
$user
->getUserGroups();
24
}
25
}
26
else
if
(
$id
> 0)
27
{
28
$this->
id
= $id;
29
if
(empty(self::$groups[
$id
]))
30
{
31
self::$groups[
$id
] =
\Bitrix\Main\UserTable::getUserGroupIds
(
$id
);
32
}
33
}
34
35
if
(empty(self::$groups[
$id
]))
36
{
37
self::$groups[
$id
] = [2];
38
}
39
40
$this->forumUser = Forum\User::getById($this->
id
);
41
}
42
43
public
function
getId
()
44
{
45
return
$this->id
;
46
}
47
48
public
function
getGroups
()
49
{
50
return
implode(
","
, self::$groups[$this->
id
]);
51
}
52
53
public
function
getUserGroupArray
()
54
{
55
return
self::$groups[
$this->id
];
56
}
57
58
public
function
isAuthorized
()
59
{
60
return
true
;
61
}
62
63
public
function
getParam
(
string
$key
)
64
{
65
if
($this->forumUser instanceof
Forum
\
User
)
66
{
67
return
$this->forumUser[
$key
];
68
}
69
return
null
;
70
}
71
public
function
isAdmin
()
72
{
73
return
false
;
74
}
75
public
function
getUserGroup
()
76
{
77
return
self::$groups[
$this->id
];
78
}
79
public
function
getFirstName
()
80
{
81
return
''
;
82
}
83
public
function
getLastName
()
84
{
85
return
''
;
86
}
87
public
function
getSecondName
()
88
{
89
return
''
;
90
}
91
public
function
getLogin
()
92
{
93
return
''
;
94
}
95
public
function
getFullName
()
96
{
97
return
''
;
98
}
99
100
public
function
getUnreadMessageId
($topicId = 0)
101
{
102
if
($this->forumUser instanceof
Forum
\
User
)
103
{
104
return
$this->forumUser->getUnreadMessageId($topicId);
105
}
106
return
null
;
107
}
108
109
public
function
readTopic
($topicId = 0)
110
{
111
if
($this->forumUser instanceof
Forum
\
User
)
112
{
113
$this->forumUser->readTopic($topicId);
114
$this->forumUser->setLastVisit();
115
}
116
}
117
118
public
function
setLocation
(
int
$forumId = 0,
int
$topicId = 0)
119
{
120
if
($this->forumUser instanceof
Forum
\
User
)
121
{
122
$this->forumUser->setLocation($forumId, $topicId);
123
}
124
}
125
}
Bitrix\Forum\Comments\User
Определения
user.php:10
Bitrix\Forum\Comments\User\getUserGroupArray
getUserGroupArray()
Определения
user.php:53
Bitrix\Forum\Comments\User\getId
getId()
Определения
user.php:43
Bitrix\Forum\Comments\User\getFullName
getFullName()
Определения
user.php:95
Bitrix\Forum\Comments\User\$id
int $id
Определения
user.php:11
Bitrix\Forum\Comments\User\getUnreadMessageId
getUnreadMessageId($topicId=0)
Определения
user.php:100
Bitrix\Forum\Comments\User\setLocation
setLocation(int $forumId=0, int $topicId=0)
Определения
user.php:118
Bitrix\Forum\Comments\User\getUserGroup
getUserGroup()
Определения
user.php:75
Bitrix\Forum\Comments\User\getSecondName
getSecondName()
Определения
user.php:87
Bitrix\Forum\Comments\User\getGroups
getGroups()
Определения
user.php:48
Bitrix\Forum\Comments\User\getLastName
getLastName()
Определения
user.php:83
Bitrix\Forum\Comments\User\getLogin
getLogin()
Определения
user.php:91
Bitrix\Forum\Comments\User\readTopic
readTopic($topicId=0)
Определения
user.php:109
Bitrix\Forum\Comments\User\__construct
__construct(int $id)
Определения
user.php:15
Bitrix\Forum\Comments\User\isAdmin
isAdmin()
Определения
user.php:71
Bitrix\Forum\Comments\User\isAuthorized
isAuthorized()
Определения
user.php:58
Bitrix\Forum\Comments\User\getFirstName
getFirstName()
Определения
user.php:79
Bitrix\Forum\Comments\User\$forumUser
$forumUser
Определения
user.php:13
Bitrix\Forum\Comments\User\getParam
getParam(string $key)
Определения
user.php:63
Bitrix\Main\UserTable\getUserGroupIds
static getUserGroupIds($userId)
Определения
user.php:250
Bitrix\Forum
Bitrix\Main\$user
$user
Определения
mysql_to_pgsql.php:33
$key
if(empty($signedUserToken)) $key
Определения
quickway.php:257
bitrix
modules
forum
lib
comments
user.php
Создано системой
1.14.0