1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
usages.php
См. документацию.
1
<?php
2
namespace
Bitrix\Bizproc\Workflow\Template\Collection
;
3
4
class
Usages
5
{
6
protected
$list
;
7
8
public
function
__construct
()
9
{
10
$this->list = [];
11
}
12
13
public
function
add
($ownerId, $sourceType, $value)
14
{
15
if
(!isset($this->list[$sourceType]))
16
{
17
$this->list[$sourceType] = [];
18
}
19
$key
=
"{$ownerId}#{$value}"
;
20
$this->list[$sourceType][
$key
] = [$ownerId, $value];
21
return
$this;
22
}
23
24
public
function
addOwnerSources
($ownerId,
array
$sources
)
25
{
26
foreach
(
$sources
as $source)
27
{
28
$this->
add
($ownerId, $source[0], $source[1]);
29
}
30
return
$this;
31
}
32
33
public
function
getBySourceType
($sourceType)
34
{
35
return
isset($this->list[$sourceType]) ? array_values($this->list[$sourceType]) : [];
36
}
37
38
public
function
getValuesBySourceType
($sourceType):
array
39
{
40
$result
= $this->
getBySourceType
($sourceType);
41
$result
= array_column(
$result
, 1);
42
return
array_unique(
$result
);
43
}
44
45
public
function
getByOwner
($ownerId)
46
{
47
$list
= [];
48
foreach
($this->list as $sourceType =>
$items
)
49
{
50
foreach
(
$items
as list($id, $value))
51
{
52
if
($ownerId === $id)
53
{
54
$list
[] = [$sourceType, $value];
55
}
56
}
57
}
58
return
$list
;
59
}
60
61
public
function
getAll
()
62
{
63
return
$this->list
;
64
}
65
}
Bitrix\Bizproc\Workflow\Template\Collection\Usages
Определения
usages.php:5
Bitrix\Bizproc\Workflow\Template\Collection\Usages\__construct
__construct()
Определения
usages.php:8
Bitrix\Bizproc\Workflow\Template\Collection\Usages\getValuesBySourceType
getValuesBySourceType($sourceType)
Определения
usages.php:38
Bitrix\Bizproc\Workflow\Template\Collection\Usages\$list
$list
Определения
usages.php:6
Bitrix\Bizproc\Workflow\Template\Collection\Usages\add
add($ownerId, $sourceType, $value)
Определения
usages.php:13
Bitrix\Bizproc\Workflow\Template\Collection\Usages\addOwnerSources
addOwnerSources($ownerId, array $sources)
Определения
usages.php:24
Bitrix\Bizproc\Workflow\Template\Collection\Usages\getAll
getAll()
Определения
usages.php:61
Bitrix\Bizproc\Workflow\Template\Collection\Usages\getBySourceType
getBySourceType($sourceType)
Определения
usages.php:33
Bitrix\Bizproc\Workflow\Template\Collection\Usages\getByOwner
getByOwner($ownerId)
Определения
usages.php:45
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$sources
$sources
Определения
options.php:35
Bitrix\Bizproc\Workflow\Template\Collection
Определения
usages.php:2
$key
if(empty($signedUserToken)) $key
Определения
quickway.php:257
$items
$items
Определения
template.php:224
bitrix
modules
bizproc
lib
workflow
template
collection
usages.php
Создано системой
1.14.0