1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
socnetgroup.php
См. документацию.
1<?php
8
9namespace Bitrix\Main\UI\AccessRights\Entity;
10
11
12use Bitrix\Main\Access\AccessCode;
13use Bitrix\Socialnetwork\WorkgroupTable;
14
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}
getAvatar(int $width=58, int $height=58)
Определения socnetgroup.php:39
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$width
Определения html.php:68
const SITE_ID
Определения sonet_set_content_view.php:12