1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
UserGroupItemFactory.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Notification\Group\UserGroup;
4
5use Bitrix\Im\Model\EO_NotifyGroup;
6use Bitrix\Im\Model\NotifyGroupTable;
7use Bitrix\Im\V2\Notification\Group\Condition\ConditionFactory;
8use Bitrix\Im\V2\Notification\Group\GroupItem;
9use Bitrix\Im\V2\Notification\Group\GroupItemCollection;
10
12{
13 private const MAX_ITEMS_LIMIT = 1000;
14
15 private readonly ConditionFactory $conditionFactory;
16
17 public function __construct()
18 {
19 $this->conditionFactory = new ConditionFactory();
20 }
21
23 {
24 $groups = NotifyGroupTable::query()
25 ->where(NotifyGroupTable::FIELD_USER_ID, $userId)
26 ->setSelect([
27 NotifyGroupTable::FIELD_ID,
28 NotifyGroupTable::FIELD_TITLE,
29 NotifyGroupTable::RELATION_CONDITIONS,
30 ])
31 ->setLimit(self::MAX_ITEMS_LIMIT)
32 ->addOrder(NotifyGroupTable::FIELD_ID)
33 ->fetchCollection()
34 ;
35
36 $groupItems = array_map(
37 fn(EO_NotifyGroup $group): GroupItem => new GroupItem(
38 tag: (string)$group->getId(),
39 title: (string)$group->getTitle(),
40 conditions: $this->conditionFactory->convertCollectionToConditionsDto($group->getConditions()),
41 isEditable: true
42 ),
43 $groups->getAll(),
44 );
45
46 return new GroupItemCollection(...$groupItems);
47 }
48}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
$groups
Определения options.php:30
<? endif;?> window document title
Определения prolog_main_admin.php:76