Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
author.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Integration\AI\User
;
4
5
class
Author
6
{
7
private
int
$userId;
8
private
array $user;
9
10
public
function
__construct
(
int
$userId)
11
{
12
$this->userId = $userId;
13
$this->init();
14
}
15
16
public
function
getName
(): string
17
{
18
return
trim(
"{$this->user['NAME']} {$this->user['LAST_NAME']}"
);
19
}
20
21
public
function
getWorkPosition
(): string
22
{
23
return
(
string
)$this->user[
'WORK_POSITION'
];
24
}
25
26
public
function
toMeta
(): array
27
{
28
return
[
29
'author'
=> [
30
'name'
=> $this->
getName
(),
31
'work_position'
=> $this->
getWorkPosition
(),
32
],
33
];
34
}
35
36
private
function
init(): void
37
{
38
$this->user = \CUser::GetByID($this->userId)->Fetch();
39
}
40
}
Bitrix\Socialnetwork\Integration\AI\User\Author
Definition
author.php:6
Bitrix\Socialnetwork\Integration\AI\User\Author\toMeta
toMeta()
Definition
author.php:26
Bitrix\Socialnetwork\Integration\AI\User\Author\getName
getName()
Definition
author.php:16
Bitrix\Socialnetwork\Integration\AI\User\Author\getWorkPosition
getWorkPosition()
Definition
author.php:21
Bitrix\Socialnetwork\Integration\AI\User\Author\__construct
__construct(int $userId)
Definition
author.php:10
Bitrix\Socialnetwork\Integration\AI\User
Definition
author.php:3
modules
socialnetwork
lib
integration
ai
user
author.php
Создано системой
1.10.0