1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectionaccesscontroller.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Access;
4
5use Bitrix\Calendar\Access\Model\SectionModel;
6use Bitrix\Calendar\Access\Model\UserModel;
7use Bitrix\Main\Access\AccessibleItem;
8use Bitrix\Main\Access\BaseAccessController;
9use Bitrix\Main\Access\User\AccessibleUser;
10use Bitrix\Calendar\Core\Mappers\Section;
11
13{
14 public static array $cache = [];
15
16 private const ITEM_TYPE = 'SECTION';
17 private const USER_TYPE = 'USER';
18
19 protected function loadItem(int $itemId = null): ?AccessibleItem
20 {
21 $key = self::ITEM_TYPE . '_' . $itemId;
22 if (!array_key_exists($key, static::$cache))
23 {
25 $section = (new Section())->getById($itemId);
26
27 $sectionModel = SectionModel::createFromId($itemId);
28 if ($section instanceof \Bitrix\Calendar\Core\Section\Section)
29 {
30 $owner = $section->getOwner();
31 $ownerId = $owner ? $owner->getId() : 0;
32 $sectionModel
33 ->setType($section->getType())
34 ->setOwnerId($ownerId)
35 ;
36 }
37
38 static::$cache[$key] = $sectionModel;
39 }
40
41 return static::$cache[$key];
42 }
43
44 protected function loadUser(int $userId): AccessibleUser
45 {
46 $key = self::USER_TYPE . '_' . $userId;
47 if (!array_key_exists($key, static::$cache))
48 {
49 static::$cache[$key] = UserModel::createFromId($userId);
50 }
51
52 return static::$cache[$key];
53 }
54}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(empty($signedUserToken)) $key
Определения quickway.php:257