Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factorysocialnetwork.php
1<?php
2
4
7
9{
10 public static function onBuildFilterFactoryMethods(Event $event)
11 {
12 return new EventResult(
13 EventResult::SUCCESS,
14 [
15 'callbacks' => [
16 \Bitrix\Socialnetwork\UserToGroupTable::getUfId() => function($entityTypeName, array $settingsParams, array $additionalParams = null) {
17
18 if ($entityTypeName === \Bitrix\Socialnetwork\UserToGroupTable::getUfId())
19 {
20 $settings = new \Bitrix\Socialnetwork\Filter\UserToGroupSettings($settingsParams);
21 $filterID = $settings->getId();
22
23 return new \Bitrix\Main\Filter\Filter(
24 $filterID,
25 new \Bitrix\Socialnetwork\Filter\UserToGroupDataProvider($settings),
26 [ ]
27 );
28
29 }
30 },
31 \Bitrix\Socialnetwork\WorkgroupTable::getUfId() => function($entityTypeName, array $settingsParams, array $additionalParams = null) {
32
33 if ($entityTypeName === \Bitrix\Socialnetwork\WorkgroupTable::getUfId())
34 {
35 $settings = new \Bitrix\Socialnetwork\Filter\WorkgroupSettings($settingsParams);
36 $filterID = $settings->getId();
37
38 return new \Bitrix\Main\Filter\Filter(
39 $filterID,
40 new \Bitrix\Socialnetwork\Filter\WorkgroupDataProvider($settings, $additionalParams),
41 [ ]
42 );
43
44 }
45 },
46 ]
47 ],
48 'socialnetwork'
49 );
50 }
51}