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