1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
socnetgroup.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Main\UI\AccessRights\Entity;
10
11
12
use Bitrix\Main\Access\AccessCode;
13
use Bitrix\Socialnetwork\WorkgroupTable;
14
15
class
SocnetGroup
extends
EntityBase
16
{
17
private
static
$modelsCache = [];
18
19
public
function
getType
(): string
20
{
21
return
AccessCode::TYPE_SOCNETGROUP;
22
}
23
24
public
function
getName
(): string
25
{
26
if
($this->model)
27
{
28
return
$this->model->getName();
29
}
30
return
''
;
31
}
32
33
public
function
getUrl
(): string
34
{
35
$groupUrlTemplate = \COption::GetOptionString(
"socialnetwork"
,
"group_path_template"
,
"/workgroups/group/#group_id#/"
,
SITE_ID
);
36
return
str_replace(
array
(
"#group_id#"
,
"#GROUP_ID#"
), $this->
getId
(), $groupUrlTemplate);
37
}
38
39
public
function
getAvatar
(
int
$width
= 58,
int
$height = 58): ?string
40
{
41
if
($this->model)
42
{
43
$arFile = \CFile::GetFileArray($this->model->getImageId());
44
if
(is_array($arFile))
45
{
46
return
$arFile[
'SRC'
];
47
}
48
}
49
return
''
;
50
}
51
52
protected
function
loadModel
()
53
{
54
if
(!$this->model)
55
{
56
if
(array_key_exists($this->
id
, self::$modelsCache))
57
{
58
$this->model = self::$modelsCache[
$this->id
];
59
}
60
else
61
{
62
$this->model = WorkgroupTable::getList([
63
'select'
=> [
64
'ID'
,
65
'NAME'
,
66
'IMAGE_ID'
,
67
],
68
'filter'
=> [
69
'=ID'
=> $this->
id
,
70
],
71
'limit'
=> 1,
72
])->fetchObject();
73
74
self::$modelsCache[
$this->id
] =
$this->model
;
75
}
76
}
77
}
78
}
Bitrix\Main\UI\AccessRights\Entity\EntityBase
Определения
entitybase.php:13
Bitrix\Main\UI\AccessRights\Entity\EntityBase\$model
$model
Определения
entitybase.php:15
Bitrix\Main\UI\AccessRights\Entity\EntityBase\getId
getId()
Определения
entitybase.php:23
Bitrix\Main\UI\AccessRights\Entity\EntityBase\$id
$id
Определения
entitybase.php:14
Bitrix\Main\UI\AccessRights\Entity\SocnetGroup
Определения
socnetgroup.php:16
Bitrix\Main\UI\AccessRights\Entity\SocnetGroup\getName
getName()
Определения
socnetgroup.php:24
Bitrix\Main\UI\AccessRights\Entity\SocnetGroup\loadModel
loadModel()
Определения
socnetgroup.php:52
Bitrix\Main\UI\AccessRights\Entity\SocnetGroup\getAvatar
getAvatar(int $width=58, int $height=58)
Определения
socnetgroup.php:39
Bitrix\Main\UI\AccessRights\Entity\SocnetGroup\getType
getType()
Определения
socnetgroup.php:19
Bitrix\Main\UI\AccessRights\Entity\SocnetGroup\getUrl
getUrl()
Определения
socnetgroup.php:33
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$width
$width
Определения
html.php:68
SITE_ID
const SITE_ID
Определения
sonet_set_content_view.php:12
bitrix
modules
main
lib
ui
accessrights
entity
socnetgroup.php
Создано системой
1.14.0