Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
entitydataprovider.php
1
<?php
2
namespace
Bitrix\Main\Filter
;
3
4
use
Bitrix\Main
;
5
6
abstract
class
EntityDataProvider
extends
DataProvider
7
{
14
protected
function
getFieldName
($fieldID)
15
{
16
throw
new
Main\NotImplementedException
(
'Method getFieldName must be overridden'
);
17
}
25
protected
function
createField
($fieldID, array $params =
null
)
26
{
27
if
(!is_array($params))
28
{
29
$params = [];
30
}
31
32
if
(!isset($params[
'name'
]))
33
{
34
$params[
'name'
] = $this->
getFieldName
($fieldID);
35
}
36
37
return
new
Field
($this, $fieldID, $params);
38
}
39
40
protected
function
getUserEntitySelectorParams
(
string
$context, array $params): array
41
{
42
$entities = [
43
[
44
'id'
=>
'user'
,
45
'options'
=> [
46
'inviteEmployeeLink'
=>
false
,
47
'intranetUsersOnly'
=>
true
,
48
]
49
],
50
];
51
52
if
(class_exists(\
Bitrix
\Socialnetwork\Integration\UI\EntitySelector\FiredUserProvider::class))
53
{
54
$entities[] = [
55
'id'
=>
'fired-user'
,
56
'options'
=> [
57
'inviteEmployeeLink'
=>
false
,
58
'intranetUsersOnly'
=>
true
,
59
'fieldName'
=> $params[
'fieldName'
],
60
'referenceClass'
=> ($params[
'referenceClass'
] ??
null
),
61
'entityTypeId'
=> ($params[
'entityTypeId'
] ??
null
),
62
'module'
=> ($params[
'module'
] ??
null
),
63
]
64
];
65
}
66
67
$isEnableAllUsers = isset($params[
'isEnableAllUsers'
]) && $params[
'isEnableAllUsers'
] ===
true
;
68
$isEnableOtherUsers = isset($params[
'isEnableOtherUsers'
]) && $params[
'isEnableOtherUsers'
] ===
true
;
69
70
if
($isEnableAllUsers || $isEnableOtherUsers)
71
{
72
$metaUser = [
73
'id'
=>
'meta-user'
,
74
'options'
=> [],
75
];
76
77
if
($isEnableAllUsers)
78
{
79
$metaUser[
'options'
][
'all-users'
] =
true
;
80
}
81
if
($isEnableOtherUsers)
82
{
83
$metaUser[
'options'
][
'other-users'
] =
true
;
84
}
85
86
$entities[] = $metaUser;
87
}
88
89
return
[
90
'params'
=> [
91
'multiple'
=>
'Y'
,
92
'dialogOptions'
=> [
93
'height'
=> 200,
94
'context'
=> $context,
95
'entities'
=> $entities,
96
'showAvatars'
=>
true
,
97
'dropdownMode'
=>
false
,
98
],
99
],
100
];
101
}
102
}
Bitrix\Main\Filter\DataProvider
Definition
dataprovider.php:5
Bitrix\Main\Filter\EntityDataProvider
Definition
entitydataprovider.php:7
Bitrix\Main\Filter\EntityDataProvider\getFieldName
getFieldName($fieldID)
Definition
entitydataprovider.php:14
Bitrix\Main\Filter\EntityDataProvider\getUserEntitySelectorParams
getUserEntitySelectorParams(string $context, array $params)
Definition
entitydataprovider.php:40
Bitrix\Main\Filter\EntityDataProvider\createField
createField($fieldID, array $params=null)
Definition
entitydataprovider.php:25
Bitrix\Main\Filter\Field
Definition
field.php:5
Bitrix\Main\NotImplementedException
Definition
exception.php:147
Bitrix\Main\Filter
Bitrix\Main
Bitrix
modules
main
lib
filter
entitydataprovider.php
Создано системой
1.10.0